[Development] qmake vcxproj generator issue

raven-worx Software info at raven-worx.net
Wed Dec 17 16:10:12 CET 2014


Hi,

i am using the command "qmake -tp vc -r" to generate Visual Studio projects.
With Qt 5.3 and MSVC2008 this worked flawlessly.
But since Qt 5.4 can't be compiled with MSVC2008 anymore i switched to  
MSVC2013.
The command runs without errors and creates the .vcxproj files, so far  
so good.

Now the problem occurs in the QtCore project (probably also in others,  
but i am stuck here for now):

There are custom build steps generated for "qstring_compat.obj" and  
"qvector_msvc.obj". (Because they can't be compiled with precompiled  
headers).

Building the generated project results in an linker error for these 2  
files. That is because the command line for this custom build step is  
missing the compiler flags. This causes that the msvc linker tries  
then to link incompatible obj files. In detail it is trying to link  
'StaticRelease' binaries with 'DynamicDebug'/'DynamicRelease' binaries.

E.g. the command written to the project file looks like this:
cl -c $(CXXFLAGS) <SOME-INCLUDE-FLAGS> tools\qstring_compat.cpp  
-Fo.obj\debug\qstring_compat.obj

Notice the $(CXXFLAGS). Which is actually a left-over from the qmake  
project generation process and wasn't substituted?! The $(CXXFLAGS) is  
interpreted by MSVC and expanded as "" since it is an unknown macro.

So the problem is that qmake doesn't expand the $(CXXFLAGS) with the  
same compiler flags used by the project to match all other object files.

Or is the fault on my side? Please let me know.






More information about the Development mailing list