Visual Studio 2013 and Qt5: QTDIR installed too late

Everything works with Qt in MSVC2013, except for one: DLLs were not found because $ (QTDIR) is not detected when the local debugging environment is installed.

My debugging environment settings:

PATH=$(QTDIR)\bin%3b$(PATH)

My .user file:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
    <QTDIR>C:\Qt\Qt5.4.1\5.4\msvc2013</QTDIR>
    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <LocalDebuggerEnvironment>PATH="$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
    <QTDIR>C:\Qt\Qt5.4.1\5.4\msvc2013</QTDIR>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <LocalDebuggerEnvironment>PATH="$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
  </PropertyGroup>
</Project>

I do not know why, but the variable $ (QTDIR) is not available for LocalDebuggerEnvironment.

It works with the following debugging environment settings:

PATH=C:\Qt\Qt5.4.1\5.4\msvc2013\bin%3b$(PATH)

Is it possible for Visual Studio to handle this correctly or do I need to enter the path manually?

+4
source share
2 answers

Visual Studio seems to parse the lines from top to bottom, so with your code ...

<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
<QTDIR>C:\Qt\Qt5.4.1\5.4\msvc2013</QTDIR>

... $(QTDIR) .

, :

<QTDIR>C:\Qt\Qt5.4.1\5.4\msvc2013</QTDIR>
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>

. Visual Studio .user , () Visual Studio .

+6

. , - Qt 5.8/QT Extension Windows 2.1.1/Visual Studio 2015. , "$ (QTDIR)\bin" ( Qt DLL) PATH spec VStudio Project Debugger... , , , .

", " , Debugger, Environment "PATH = $(QTDIR)\bin;...; $(PATH)" VStudio , PATH () "PATH = D:\TechApps\Qt\5.8\msvc2015_64b\bin;..." - , QTDIR . !

, " ", , PATH, Qt- VStudio, . PATH "\ bin;...". , Qt DLL $(QTDIR)\bin . . PATH (, , getenv ( "PATH" ) ++, , PATH QTDIR. ( , , QTDIR .)

FWIW, , VStudio, $(QTDIR) .

, ( ... vcxproj.user), , . () QTDIR , PATH, , , $(QTDIR) , Visual Studio.

, , "Qt VS Tools" "Qt Project Settings" VStudio .user.

0

All Articles