tags:

views:

68

answers:

1

I've got a buildenvironment based on Qt .pro files transformed to both Visual Studio 2008 solutions and Makefiles (used by nmake). There are about 30 projects, untill recently all compiled into a seperate dll (and the main into an exe).

Recently I added a project configured as static lib. Visual Studio links everything just fine. nmake has unresolved externals to every symbol used from this static lib.

Project sequence in the Makefile is OK Qt's dependencies are OK

used: Visual Studio 2008 Qt Visual Studio Integration 1.4.3 Qt 4.5.2

Any suggestions? All the logs combined, or any usefull selection of them, are too way big to post.

A: 

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.

Pieter