PDA

View Full Version : shared versus static build



jcr
23rd January 2006, 23:11
Hi,
I am using qt4.1 for Windows Open Source and I built fist built Qt "shared". Then I built it "static". If I want to have my exe released in a "share" mode again, do I need to rebuild Qt using first configure -shared? Is there a way to switch from "shared" to "static" without having to rebuild qt? thanks in advance

wysota
24th January 2006, 00:55
I think it is enough to add "CONFIG+=static" to your project file (not sure about it though, if not, you have to provide some switch for your compiler).

KjellKod
28th January 2006, 08:05
I'm not completely sure here but it's very easy for you to test my solution.
If CONFIG+=static (as suggested above) works then the binary will be (much) bigger than the normal shared binary. Just compile twice with different Makefiles one with static and one with shared and compare.

If it doesn't work then you'll probably also have to set the Windows QT path, much like you set the PATHS normally in Windows. If you don't know how to do this then just check the installation instructions that trolltech has for Qt on Windows. The PATH model is more of a pain since you'll have to change the path every time you want to switch between shared/static.

Good luck :)