PDA

View Full Version : Linux static compile



Sashabn
30th July 2015, 17:28
Hi, i am using Qt 5.5.0 and i was it compile to build apps as static apps.
Now when i try to start my app on different computer i got this error:
./test: error while loading shared libraries: libicui18n.so.55: cannot open shared object file: No such file or directory
and ldd output:
ldd test
linux-vdso.so.1 (0x00007fff0b5b3000)
libz.so.1 => /lib64/libz.so.1 (0x00007fcfc7de0000)
libicui18n.so.55 => not found
libicuuc.so.55 => not found
libicudata.so.55 => not found
libdl.so.2 => /lib64/libdl.so.2 (0x00007fcfc7bdc000)
libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007fcfc79da000)
libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007fcfc76a3000)
librt.so.1 => /lib64/librt.so.1 (0x00007fcfc749b000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fcfc7280000)
libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.4/libstdc++.so.6 (0x00007fcfc6f7c000)
libm.so.6 => /lib64/libm.so.6 (0x00007fcfc6c7b000)
libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.4/libgcc_s.so.1 (0x00007fcfc6a65000)
libc.so.6 => /lib64/libc.so.6 (0x00007fcfc66cd000)
/lib64/ld-linux-x86-64.so.2 (0x00007fcfc7ff6000)

Where i am make mistake ?

anda_skoa
30th July 2015, 21:07
Not sure what you mean with mistake.

The system's dynamic loader can't find some of the libraries your application is dynamically linking.
There is no Qt library in that list, so you built Qt correctly for static linking.

Cheers,
_

ChrisW67
30th July 2015, 21:32
Your build computer has these ICU libraries at a binary "version" 55. Your target machine has no ICU library at all or possibly has ICU libraries but at a different binary "version".

Your statically linked Qt library is dynamically linked to other libraries, ICU included, because these were the ICU libs that configure/your linker found when you built Qt itself. If you wish to remove this dynamic ICU dependency from Qt then you need to rebuild Qt with a static linking build of ICU available (so the linker can use it) and ensure that it is used in preferrence to the dynamic version that will also be present.