Details
-
Bug
-
Resolution: Won't Do
-
Not Evaluated
-
2.6.0 (rev.07)
-
None
-
Windows 10
Visual Studio 2019
Description
The Project Structure I designed in VS:
bin // Output Files and Third-Party DLL win32 win64 include // Third-Party Headers lib // Third-Party Library win32 win64 src // Source Files QtSolution // Solution Folder QtProject1 // Project Folder build // Intermediate Folder
First, I created a QtWidgetApplication in Visual Studio.
Then, I made some changes in Project Properties.
(1) Output Directory: $(SolutionDir)..\..\bin\win32
(2) Intermediate Directory: $(ProjectDir)build\$(Configuration)
(3) Working Directory: $(SolutionDir)..\..\bin\win32
(4) Additional Include Directories: $(Solution)..\..\include
(5) Additional Library Directories: $(Solution)..\..\lib\win32
Something wrong with "Create Basic .pro File"
After setting up the Project Properties, I build the project and run the ouput executable. It works successfully. And then I pressed "Create Basic .pro File" so that I could open and edit in QtCreator (if I want to). However, in the .pro file that VS created, I found that
DESTDIR = ../../bin/win32
LIBS += -L"$(SolutionDir)../../lib/win32"
DEPENDPATH += .
MOC_DIR += .
UI_DIR += .
RCC_DIR += .
Moreover, After opening .pro file with QtCreator, I tried to build the project, but an error showed up:
error: C1083: 無法開啟包含檔案: 'ui_qtwidgetsapplication1.h': No such file or directory
Indeed, After I checked the Intermediate Folder created by QtCreator, I didn't find 'ui_qtwidgetsapplication1.h'.
It looks like that
the directory of Generated Files created by Visual Studio are: (Inside the Project Folder)
$(ProjectDir)build/Debug/moc/ $(ProjectDir)build/Debug/rcc/ $(ProjectDir)build/Debug/qrc/
And the directory of Generated Files created by QtCreator are: (Outside the Project Folder)
$(ProjectDir)../build-QtWidgetsApplication1-Desktop_Qt_5_15_0_VS2019_32bit-Debug/debug/
Questions I sorted out to ask
It looks like that Visual Studio has some bugs when "Creating Basic .pro File".
(1) Why doesn't DEPENDPATH have "$(SolutionDir)../../include"??
(2) Why doesn't DESTDIR have "$(SolutionDir)"??
(3) Does $(SolutionDir) work in QtCreator? (I guess not) Then, Does that mean that I had better not use VS-default variables in Project Properties??
(4) Why MOC_DIR, UI_DIR, RCC_DIR are "."??
(5) Why didn't QtCreator create 'ui_qtwidgetsapplication1.h'?