PDA

View Full Version : Help compiling Qt4 Application



drake1983
14th November 2007, 03:51
Hello everyone, I have developed an small application using Qt4 and QtOpengl module, but I need to run it in a Linux system without Qt4 libs installed.

I have read about compiling using static libraries, but I need help.
How can I do that?


Thanks.

DeepDiver
14th November 2007, 08:46
Why don't you just use Qt4 packages on linux.
It's so easy to get the libs installed on Linux without compilation.

drake1983
14th November 2007, 21:09
hi again, thanks for your answer and forgive my English.

this is what I want to do:

I have developed a Qt Application using Qt4 on Linux.
The app binary runs on my computer because I have Qt4 installed, but, how can I run it in another computer without Qt? For example, On windows you put together the .exe and some Qt's dll, like QtCore.dll, and It runs everywere. I want to do that, in Linux.


Thanks!!

holysmoke
15th November 2007, 14:09
Hi,
I guess what you want to do is to have your application run on a system regardless of whether Qt is installed on that system or not.

So basically you are looking for static linking against Qt libraries. Now, in order to link statically against Qt, static Qt libraries must exists in the first place.
AFAIK, you can build Qt with static libraries by using the static option while configuring


configure -static #see configure --help for more

Also, I think -static & -shared are mutually exclusive because I didn't see any option like -debug-and-release

Let me warn you that using static libraries will probably increase your disk space requirement exponentially. On my Windows system Qt built with shared libraries takes around 1.65 GB, it think it could easily take 5~10 GB using static libraries or maybe even more.

HTH

drake1983
15th November 2007, 14:32
Yes, that's exactly what I want, thanks so much for your answer.