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

Importing .pro file can produce broken .vcxproj when auto-generating .qrc files

    XMLWordPrintable

Details

    • c8d7ec4da (dev)

    Description

      Code

      # Pro2VcxprojTest.pro
      QT -= gui
      
      SOURCES += main.cpp
      
      myresources.files = hello.json
      myresources.prefix = /
      RESOURCES += myresources
      

       

      Steps to reproduce

      1. Use "Extensions" > "Qt VS Tools" > "Open Qt Project File (.pro)..." to import the attached project
      2. Try to build the project

       

      Outcomes

      warning MSB8027: Two or more files with the name of qrc_qmake_myresources.cpp will produce outputs to the same location. This can lead to an incorrect build result.  The files involved are Debug\qrc_qmake_myresources.cpp, Debug\qrc_qmake_myresources.cpp.
      

       

      Workarounds

      • Manually right-click one of the .qrc files and select "Exclude From Project", OR
      • Instead of using "inline" resources, put them under a .qrc file in the .pro file before importing, OR
      • Instead of using the Qt VS Tools extension, use the console to run `qmake.exe -tp vc -r Pro2VcxprojTest.pro`. This generates a project that correctly excludes one of the .qrc files

      Attachments

        For Gerrit Dashboard: QTVSADDINBUG-1113
        # Subject Branch Project Status CR V

        Activity

          People

            heimrich Karsten Heimrich
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes