PDA

View Full Version : Problem when linking with own static libraries



herveT
5th May 2009, 16:50
Hello all,

I'm working under Windows XP.

I built static library (say it is called MyStaticLib) I would like to use in my application. The building is ok but when I launch my app, the program stops because it can't find the DLL for MyStaticLib. Is there any options I should set in the .pro files to force the compiler to link statically my lib ?

Thanks,

Dutch112
5th May 2009, 17:01
Are you using the QtDesigner?

Boron
5th May 2009, 18:57
Add a CONFIG += static in the pro-file.

Qt Designer has nothing to do with this problem, as the Designer simply creates ui-files.

Dutch112
5th May 2009, 22:19
Add a CONFIG += static in the pro-file.

Qt Designer has nothing to do with this problem, as the Designer simply creates ui-files.

I meant Qt Creator, which should allow you to add that line without having to modify the .pro file directly.

herveT
6th May 2009, 09:23
Hi,

Thanks for your replies. I'm already using QT Creator and CONFIG += staticlib has been automatically added in my .pro files when I created the project.

Here is an extract from the .pro of my static library :


TARGET = MyStaticLibrary
TEMPLATE = lib
CONFIG += staticlib

I use mingw and g++ that are provided with QTCreator under windows platforms.