P3: Somewhat important
Windows XP, Visual Studio 2008
When parsing the LIBS variable, for each entry -l qmake goes looking whether or not the file exists in the libpath. If it can find it, it adds an absolute link to the Makefile, if not it just adds the filename and lets nmake look for it itself.
I had 2 entries: -lmystatic and -lmystatic2. The first time I generate my Makefile's, it writes:
LIBS = ... mystatic.lib mystatic2.lib ...
If I regenerate my Makefile's, it should write:
LIBS = c:\sandbox\bin\mystatic.lib c:\sandbox\bin\mystatic2.lib
instead, it writes:
LIBS = c:\sandbox\bin\mystatic2.lib c:\sandbox\bin\mystatic2.lib
What I think happened is that qmake takes the list of all files that match "mystatic", and takes the first one. Unfortunately "mystatic2.lib" also matches this AND "mystatic2.lib" ends up lexically BEFORE "mystatic.lib".
The Qt Visual Studio integration does the exact same thing. VS filters out the duplicate but a .lib entry is missing along the includes. I haven't been able to find out why VS is able to link like this.
- relates to
QTBUG-30228 qmake adds wrong lib to vcxproj file