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

Link Errors on First Build (LNK2001) in Qt Vs Tools projects with RC resources

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 2.4.2 (rev.09), 2.4.3
    • 2.4.0, 2.4.1, 2.4.1 (rev.12), 2.4.1 (rev.25), 2.4.1 (rev.28), 2.4.2
    • General
    • None
    • Visual Studio 2019 Professional 16.3.6
      Qt 5.13.2
    • Windows
    • 94881b1e278a8db0de04825d816953f82b629ec1

    Description

      When attempting to build certain projects with Windows resources (.RC file) with Qt VS Tools enabled, the first build (right-click and choose "Rebuild", or "Clean" and then "Build") results in link errors. The second build succeeds. When the project is converted back to regular type (by removing   <Keyword>QtVS_v301</Keyword> from .vcxproj file) - the issue goes away.

      I stripped out everything except the bare minimum in our solution to replicate the issue.

      To replicate:

      1) Extract the attached Test.zip

      2) Open System.sln

      3) Right-click "SAS" project and choose "Rebuild", the following error occurs:

      1>SAS.vcxproj -> c:\Temp\dummy\SAS\..\programsDebug\SAS.dll
      1>SAS.vcxproj -> ..\programsDebug\SAS.pdb (Full PDB)
      1>SAS.def : error LNK2001: unresolved external symbol StartProcess

      4) Try to rebuild again - same error result

      5) Right click "SAS" and choose "Build", the builds succeeds:

      1>SAS.vcxproj -> c:\Temp\dummy\SAS\..\programsDebug\SAS.dll
      1>SAS.vcxproj -> ..\programsDebug\SAS.pdb (Full PDB)
      ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

       

      6) Manually edit SAS.vcxproj and remove " <Keyword>QtVS_v301</Keyword>" line

      7) Right-click "SAS" project and choose "Rebuild", the build succeeds

      8) Restore the project to Qt by putting the keyword back

      9) Rebuild - resulting in error

      10) Remove the RC file. Rebuild - resulting in success.

       

       

      Attachments

        Issue Links

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

          Activity

            People

              mecfc Miguel Costa
              r0ll1ngst0ne Michael Kostukov
              Votes:
              7 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes