PDA

View Full Version : Qt libs static and dynamic



conexion2000
18th May 2006, 12:55
Hello!
Is there any possibility to have static and dyamic versions of qt libs? I unpacked qt sources to 2 different folders (windows) and then in one configure -static and in the other configure -shared. Is it good way? Is there any better way?
And how can I choose if now I want use static or shared version? What about system variables? Please help.

conexion2000
18th May 2006, 14:19
Ok. Now I know that I have to do "configure -static -shared", but how can I choose if now I want to use static or shared version?

Brandybuck
18th May 2006, 19:32
I have both on my Mac, and I use a shell script to switch between them.

NormanDunbar
24th May 2006, 10:09
Morning Conexion2000,


Hello!
Is there any possibility to have static and dyamic versions of qt libs? I unpacked qt sources to 2 different folders (windows) and then in one configure -static and in the other configure -shared. Is it good way? Is there any better way?
And how can I choose if now I want use static or shared version? What about system variables? Please help.

I've installed 4.1.3 with the mingw compiler on Windows. This puts in a shared library system for QT. I then edited the file %QTDIR%\bin\qtvars.bat to see what they do when building debug libraries and simply ran those commands with the -static option to configure (without the debug) as follows :

cd %QTDIR%
configure -plugin-sql-sqlite -plugin-sql-odbc -qt-libpng -qt-libjpeg -static
cd %QTDIR%\src
mingw32-make release

I now have a shared and static version of the libraries for QT413.

In a project file for an app that needs static linking I simply put :

QMAKE_LFLAGS += -static

which works fine for me using mingw, or under GCC on Linux. When I build a project I run qmake as normal (once) then make debug or make release as required.

HTH


Cheers,
Norman.