PDA

View Full Version : Qt 4.7.4 Static Link for Linux Info



bob2oneil
15th December 2011, 06:54
There are plenty of legacy articles on static linking for a Qt application under Linux. I have read that the Qt libraries have to be rebuilt from source for static linking, and that they do not.

I have read you simply have to add "CONFIG += static" to the .pro file, but this does not work for me in Qt Creator. The ldd command and file size indicates I am still linking dynamically.

Has anyone successfully performed static linking of a Qt application (for example a console app) using a recent version of the Qt source/libraries under Linux? (say v4.7.4)

I currently have v4.7.4 installed and managed via the Qt SDK Maintenance Tool.

What is the current methods for the recent versions of the libraries.

Thanks in advance

Oleg
15th December 2011, 11:54
You should rebuild Qt from sources as static lib. And then link your app with it. This wiki page (http://www.qtcentre.org/wiki/index.php?title=Building_static_applications) is quite actual.