ldd tells me my app is "not a dynamic executable"
I just had the problem with a 32-bit binary, solution was:
apt-get install gcc-multilib
$ uname -a
Linux bla 2.6.32-028stab094.3 #1 SMP Thu Sep 22 12:47:37 MSD 2011 x86_64 GNU/Linux
The error here was due to not having enough RAM on the VirtualMachine. Running strace ./programname
indicated that the program was being killed just as it started running, before loading any of the libraries. Increasing the amount of RAM available ensured that the program could work.
Useful responses
There were some useful responses from others namely @slm who provided useful commands to check that each of the libraries existed, and @lgeorget who suggesting trying the strace
command.
Can you post some of the libraries that it does link to (from the original system)? You might just need to install some missing libraries.
Typically on a CentOS system it's just a matter of running a yum command like so:
yum install <package name>
You can work backwards from the original system like so:
$ ldd /bin/ls
linux-vdso.so.1 => (0x00007fff519ff000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00000034e8e00000)
librt.so.1 => /lib64/librt.so.1 (0x00000034e8a00000)
libcap.so.2 => /lib64/libcap.so.2 (0x0000003d6fe00000)
libacl.so.1 => /lib64/libacl.so.1 (0x00000034fae00000)
libc.so.6 => /lib64/libc.so.6 (0x00000034e7200000)
libdl.so.2 => /lib64/libdl.so.2 (0x00000034e7a00000)
/lib64/ld-linux-x86-64.so.2 (0x00000034e6e00000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00000034e7e00000)
libattr.so.1 => /lib64/libattr.so.1 (0x00000034f7600000)
In that output you can see where my copy of /bin/ls
is picking up the shared .so libraries for say example, librt.so.1
, which happens to be located here: /lib64/librt.so.1
.
Knowing this, on the original system, you can run this command to figure out what package provides this library:
$ rpm -qf /lib64/librt.so.1
glibc-2.13-2.x86_64
So the package is called glibc-2.13-2.x86_64
. So to install it you'd do this:
$ sudo yum install glibc-2.13-2.x86_64