PDA

View Full Version : Building applications statically in Qt



mathewjmanavalan
24th April 2012, 05:57
Hi,

I am new to Qt programming and I am using Qt Creator 2.2.1 Based on Qt 4.7.3 (Running on Ubuntu 11.10) I wanted to build an application to run on an Ubuntu system without Qt installed and so decided to go for a static build. I followed the instructions in "http://www.qtcentre.org/wiki/index.php?title=Building_static_Qt_on_Linux"

I ran all the commands and everything but the problem now is when i try to add the new qmake to my Qt versions (in Tools-> Options) it says "Qt version not installed properly". How do I go about this ?

I am also kinda new to Linux OS as well.

Any help will be appreciated.

Thanks

ChrisW67
26th April 2012, 00:45
Are you trying to point Qt Creator at the copy of qmake installed under your install prefix when you ran "make install" (correct), or the copy of qmake in the build area (incorrect)?

mathewjmanavalan
26th April 2012, 06:51
Hey,

So the thing was the instructions i followed for compiling the static library was wrong. Slight different in the commands, made a big difference. Now its working fine and I was able to create a statically linked app. Thanks for the instruction :)

Now the problem I am facing is with the UI looking very ugly with the static version. Not much help found on the forums too. Would be very grateful if someone could point me in the right direction.

Thanks

ChrisW67
26th April 2012, 07:09
Which part of these instructions is wrong?


Qt 4.3.x and Later

type:
./configure -static -nomake demos -nomake examples -nomake tools
make
make install

There's not a lot of scope to get that wrong, especially given they are variation on what is in the official docs.

mathewjmanavalan
3rd July 2012, 06:17
So those instructions worked eventually. Like i said now the only problem is that the statically built version looks (the UI) ugly. Like old Windows 95 kinda look. Dont know how to fix it.

tarod
3rd July 2012, 08:44
I recommend you cmake :) Wonderful!

ChrisW67
5th July 2012, 10:59
I recommend you cmake Wonderful!
How is that relevant? ... unless you have ported the Qt library build to CMake in which case you should contribute it to the project. ;)


The ugly UI could be because there is still a missing dependency: perhaps FreeType. Try running ldd against your compiled application.