PDA

View Full Version : Is it possible to link the qt library files into exe?



hashb
2nd January 2010, 03:03
Hi All,

I am using QT4.6 sdk (windows platform),
When deploy the application,the QT dll files (Qtcore4.dll ,Qtgui4.dll ...) also
need to deploy together.
I am wondering if there is a way to link the qt library files into exe.
I have found there are static library files( lib*.a) in QT directory, but
add "config += static" doesn't work .

Any suggestions?
Many thanks & happy new year.

hb

Lykurg
2nd January 2010, 09:08
"Static" is the way to go. If you have problems with that first have a look at the wiki: http://wiki.qtcentre.org/index.php?title=Building_static_applications.

But be aware that if you link statically you have to use GPL or a commercial licence of Qt.

joshlareau
7th January 2010, 14:41
You have to build Qt statically. It's an option in the configure script. Then you can link against the libs you found and it will work like you expected. (Note that when you build Qt normally, the libs in the Qt directory are merely DLL import libraries. They are not static Qt libs. The names are different too. The static libs don't have a 4 on the end. )