LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Qt - Staticly builded (https://www.linuxquestions.org/questions/ubuntu-63/qt-staticly-builded-707712/)

mpele 02-26-2009 07:42 AM

Qt - Staticly builded
 
I have installed Qt on Kubuntu 8.10 with sudo apt-get install qt4-dev-tools and it works perfectly. Now I wont to transfer my program to another machine and I need staticly build program. I know that I have to rebuild qt but I don't have source for it. When I download official source code it every time report some errors.

When I try with:
./configure -static -prefix /qt
make sub-src
it goes OK. But when
sudo make install
all remaining code goes to be compiled and then error ocures.

Could anybody give me some advice what to do?

knudfl 02-26-2009 09:49 AM

Welcome to LQ.

AFAIK, there are no configure options like : -static -prefix /qt.
Please see './configure --help'

But what you probably mean, is that you want to create 'a statically linked program'
which is your program linked into one executable, including all dependencies ?

Please see 'Ermine' http://magicermine.com/
( and may be 'statifier' http://statifier.sourceforge.net/ )
.....

mpele 02-27-2009 01:26 AM

The problem was that some packages have not been installed. Afther installing libx11-dev and libxext-dev all works fine.

I have compiled Qt with ptions "-static -prefix /qt". The first means statically linked program, and second to be installed in directory /qt.

Quote:

But what you probably mean, is that you want to create 'a statically linked program'
which is your program linked into one executable, including all dependencies ?
Yes, I want to create statically linked program with qt. And I made it, but I have error on server (targeted) machine:
./test: /lib/libc.so.6: version `GLIBC_2.4' not found (required by ./test)

ldd gives:
./test: /lib/libc.so.6: version `GLIBC_2.4' not found (required by ./test)
librt.so.1 => /lib/librt.so.1 (0x00002b50ec837000)
libdl.so.2 => /lib/libdl.so.2 (0x00002b50ec940000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00002b50eca44000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00002b50ecb59000)
libm.so.6 => /lib/libm.so.6 (0x00002b50ecd57000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00002b50eceda000)
libc.so.6 => /lib/libc.so.6 (0x00002b50ecfe7000)
/lib64/ld-linux-x86-64.so.2 (0x00002b50ec712000)

So, all qt libraries are staticly linked but the libm.so.6 is not suitible. Afther "googling" I figured out that on target machine mentioned library is the old.

How could I solve this problem? If I build my program on some older distribution will that make some diference?
Or is it possible to staticly link and that library?

knudfl 02-28-2009 01:49 PM

I have no idea, what it is you are doing with 'qt',
but I'm interested, so please provide a link to where
you found the solution.

To get all the other 'libs' included in the 'statically
linked program', try a tool like 'Ermine'.

Or install "the old OS" on a spare partition or computer,
and compile your program there. Then no 'statically linked
program' is nessecary, if all libs are present on the target OS.
.....

mpele 03-02-2009 01:39 AM

Thanks for Ermine.

The link about this is on the official site:
http://doc.trolltech.com/4.4/deployment-x11.html


All times are GMT -5. The time now is 08:01 AM.