Uploaded image for project: 'Qt Visual Studio Tools'
  1. Qt Visual Studio Tools
  2. QTVSADDINBUG-859

"Create Basic .pro File" create the wrong structure in .pro (or incompatible??)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: 2.6.0 (rev.07)
    • Fix Version/s: None
    • Component/s: General, Qt/MSBuild
    • Labels:
      None
    • Environment:
      Windows 10
      Visual Studio 2019
    • Platform/s:
      Windows

      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'?

       

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            mecfc Miguel Costa
            Reporter:
            hwhsu1231 Haowei Hsu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes