Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Resource file read twice by MSBuild
Forum Updated to NodeBB v4.3 + New Features

Resource file read twice by MSBuild

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
5 Posts 2 Posters 114 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    KeithS
    wrote on 25 Apr 2025, 10:13 last edited by
    #1

    Ever since a project of mine was migrated to Qt/MSBuild, I've been getting warnings that the resource object file is read twice when linking:

    1> Qt/MSBuild: 3.3.1.1
    1> Qt: 6.9.0
    1>qrc_glade.cpp
    1>guiMain.cpp
    1>qrc_glade.cpp
    1>x64\Release\\qrc_glade.obj : warning LNK4042: object specified more than once; extras ignored
    1> Creating library x64\Release\glade.lib and object x64\Release\glade.exp

    I've searched through the build files but can't see exactly where Qt/MSBuild is getting its list of files to link. Anyone know?

    The qrc_glade.cpp is in a 'Generated Files' folder in VS Solution explorer, created from the project's qrc file.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 25 Apr 2025, 10:42 last edited by
      #2

      Please show your CMakeLists.txt

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • K Offline
        K Offline
        KeithS
        wrote on 26 Apr 2025, 07:48 last edited by KeithS
        #3

        Hi Christian, this is a Visual Studio project, it doesn't use cmake, so there is no such file.
        In the glade6.vcxproj file there is a single reference to the file:

        <ClCompile Include="generatedfiles\qrc_glade.cpp">
        

        and in the glade6.vcxproj.filters file there is also a reference :

        <ClCompile Include="generatedfiles\qrc_glade.cpp">
        
        C 1 Reply Last reply 26 Apr 2025, 08:58
        0
        • K KeithS
          26 Apr 2025, 07:48

          Hi Christian, this is a Visual Studio project, it doesn't use cmake, so there is no such file.
          In the glade6.vcxproj file there is a single reference to the file:

          <ClCompile Include="generatedfiles\qrc_glade.cpp">
          

          and in the glade6.vcxproj.filters file there is also a reference :

          <ClCompile Include="generatedfiles\qrc_glade.cpp">
          
          C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 26 Apr 2025, 08:58 last edited by
          #4

          @KeithS said in Resource file read twice by MSBuild:

          this is a Visual Studio project

          And how did you create this project? Manually? Please use a CMakeLists.txt.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          0
          • K Offline
            K Offline
            KeithS
            wrote 13 days ago last edited by
            #5

            Sorry not to reply sooner, I have been away. The project was created by VS over a period of time. THere is no CMake files as said. I guess it's some weird VS bug.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved