tags:

views:

4619

answers:

5

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

A: 

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).

tvanfosson
Or possibly just try to link the whole binary statically, by passing the -static argument to either ld or gcc.
Kjetil Jorgensen
I tried linking statically, but the library does not have a static version. The compilation just quits, saying "/usr/bin/ld: cannot find -ltbb"
Amit Kumar
+1  A: 

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

AngryWhenHungry
I exported LD_LIBRARY_PATH, but does not work.
Amit Kumar
A: 

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>
lothar
+1  A: 

Your question is a duplicate of this one.

See this answer for explanation of what is happening and how to fix it.

Employed Russian
A: 

me also hving same problem. when i installed google earth .bin file on linux knoppix. i got following error when i tried to run.

Installing mimetypes... Installing desktop menu entries... Installing desktop icon... ./googleearth-bin: /lib/tls/libc.so.6: version GLIBC_2.4' not found (required by ./googleearth-bin) ./googleearth-bin: /lib/tls/libc.so.6: versionGLIBC_2.4' not found (required by ./libgoogleearth_lib.so) ./googleearth-bin: /usr/lib/libstdc++.so.6: version GLIBCXX_3.4.9' not found (required by ./libgoogleearth_lib.so) ./googleearth-bin: /usr/lib/libstdc++.so.6: versionGLIBCXX_3.4.9' not found (required by ./libbase.so) ./googleearth-bin: /lib/tls/libc.so.6: version GLIBC_2.4' not found (required by ./libbase.so) ./googleearth-bin: /lib/tls/libc.so.6: versionGLIBC_2.4' not found (required by ./libgeobase.so) ./googleearth-bin: /lib/tls/libc.so.6: version GLIBC_2.4' not found (required by ./libauth.so) ./googleearth-bin: /lib/tls/libc.so.6: versionGLIBC_2.4' not found (required by ./libcommon.so) ./googleearth-bin: /lib/tls/libc.so.6: version GLIBC_2.4' not found (required by ./libge_net.so) ./googleearth-bin: /lib/tls/libc.so.6: versionGLIBC_2.4' not found (required by ./libgeobaseutils.so) ./googleearth-bin: /lib/tls/libc.so.6: version GLIBC_2.4' not found (required by ./librender.so) ./googleearth-bin: /lib/tls/libc.so.6: versionGLIBC_2.4' not found (required by ./libreporting.so) ./googleearth-bin: /lib/tls/libc.so.6: version `GLIBC_2.4' not found (required by ./libfusioncommon.so)

can any1 tell me how to fix this problem.

thank u in advance. reply me in [email protected]

pls help me.

Evil-reddy