Reputation: 21062
I compiled a binary and copied on another machine for execution. But I am getting the above error. On the second machine, I cannot install new libraries. I tried putting the libc from the first machine into the directory of the binary on the second machine, but the linker (as I found using ldd) still loads from the standard path /lib/tls/libc.so.6). Please let me know a least change fix for this.
Update:
Command used for compilation/linking:
g++ -O2 -DNDEBUG -o CountStrings -I../../../../../tbb/tbb20_20080408oss_src/include/ ../src/CountStrings.cpp -L../../../../../tbb/tbb20_20080408oss_src/build/linux_ia32_gcc_cc4.3.2_libc2.8.90_kernel2.6.27_release/ -ltbb
libtbb.so has dependency on libc.so.6
Upvotes: 2
Views: 41387
Reputation: 489
In fact the easier way to fix the issue is to upgrade your OS version.
For example, Java 1.7 is not running on RedHat 4 but works well on RedHat 5.
Upvotes: 3
Reputation: 20267
I am not sure what (ill) side effects it may have to use another libc than provided by the system, but you can try to force using your special libc copy with LD_PRELOAD
LD_PRELOAD=<location_of_your_lib> <yourprogram>
Upvotes: 0
Reputation: 468
Try exporting LD_LIBRARY_PATH=<location_of_your_lib>
for your process
e.g. $ LD_LIBRARY_PATH=/home/kumar ./a.out
will look for libs in /home/kumar/
before anywhere else
Upvotes: 1
Reputation: 532765
Have you checked to see if there is a static version of the library on the compilation machine? If there is you could explicitly link against it, using /lib/tls/libc.a instead of -L/lib/tls -lc (or whatever your dialect is).
Upvotes: 0