PDA

View Full Version : Building qt program with static library



JonathanForQT4
22nd June 2007, 11:32
Hello all,

I'm trying to build a program under linux with a static library (so that you can run the qt app on another machine, where the qt toolkit isn't installed).

I don't know how qt was installed on the linux box...if the libraries compiled are static or not.....I also don't know if this affects whether or not you can then build a qt app with static libs?

The only thing I can think of is in my .pro file I should add: CONFIG += staticlib ...etc.

Anything else I need to know?

Thanks!

Jonathan

JonathanForQT4
22nd June 2007, 12:29
just added template = lib to the .pro file too, but that doesn't help either :(

jacek
22nd June 2007, 23:15
I don't know how qt was installed on the linux box...if the libraries compiled are static or not.....I also don't know if this affects whether or not you can then build a qt app with static libs?
You can't build a static application without static libraries.


The only thing I can think of is in my .pro file I should add: CONFIG += staticlib ...etc.
You have to add CONFIG += static (staticlib is for libraries).


just added template = lib to the .pro file too, but that doesn't help either :(
TEMPLATE=lib is for libraries, if you want to build an application, use TEMPLATE=app.

Also read this: http://wiki.qtcentre.org/index.php?title=Building_static_applications