PDA

View Full Version : compile statically


meissner
December 11th, 2005, 01:12 PM
Hello.

I program some Qt4 Stuff and want start the programs on Linux systems where is no Qt4 available. Is there a possibility to compile my programs statically?

meissner
December 11th, 2005, 02:48 PM
I've found a solution. Compile Qt with ./configure -static and than add in the .pro File: CONFIG += static

But the binary is then at least 5MB.

mostwanted
December 11th, 2005, 04:35 PM
Hm... could you make some precompilation stuff to sort it out and then distribute the program by source?

meissner
December 12th, 2005, 07:35 AM
Does that make Sense?

I mean, I offer the source for those who had Qt4 installed and a static binary who don't want install Qt4. So everyone can decide. But I'm not sure if that is allowed to publish closed source by the license of the open source version of Qt4.

I found out that with stripe und upx I can reduce the size of the static binary to 1,8MB, thats only double of the non-static version. However I must test if it works correctly.

Maybe you are right, but I don't see advantages...

LordHunter317
December 12th, 2005, 10:14 AM
Don't statically compile QT4, lots of features won't work.

Statically compiling most things on Linux tends to lead to trouble. Better is to ship a precompiled version of the library with your code.