Saturday, July 18, 2009

Linking With Release/Debug Libraries

If you have a project that depends on a library project then you'll want the debug version to link with the debug library and the release version to link with the release library. To do this you'll need to edit your main project's .pro file and do something like this:

debug {
LIBS += -L./libfolder -lmydebuglib.lib

release {
LIBS += -L./libfolder -lmyreleaselib.lib

Note that the first brace must appear on the same line as the configuration name - the following will cause qmake to error:

LIBS += ...

I posted a question about this on Stack Overflow as well as asking on the Qt Creator mailing list.

No comments:

Post a Comment