Resource file read twice by MSBuild
-
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.expI'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.
-
Please show your CMakeLists.txt
-
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">
-
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">
@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.