Jun 20, 2014 at 5:08am UTC
Hi all,
currently I'm facing a issue in linking a .so file.
In my build machine, I've libcrypto.so.6 and there is a softlink as libcrypto.so.
In my make file I'm trying to link to the lib using -L -lcrypto and it is success and created my test.exe.
When I copy this test.exe to other machine, there libcrypto.so is present but it is looking for libcrypto.so.6. Due to which the exe is not coming up.
Eg: ldd -r test.exe
libcrypto.so.10 => /usr/lib/libcrypto.so.10 (0x00f69000)
But my as per my understanding this should point to
libcrypto.so => /usr/lib/libcrypto.so.10 (0x00f69000)
How to resolve this problem and what is happening internally.
Thanks
Vijay
Last edited on Jun 20, 2014 at 9:34am UTC
Jun 20, 2014 at 1:57pm UTC
You can statically link. That is, link to libcrypto.a.
You can do that by telling the linker you need a static link. You need to pass -Wl,-Bstatic -lcrypto
Jun 20, 2014 at 5:05pm UTC
Last edited on Jun 20, 2014 at 8:13pm UTC
Jun 21, 2014 at 10:00pm UTC
It you continue to use shared libs, you'll continue to have the problem of other systems not having the same version of stuff that's on your build machine.
Jun 22, 2014 at 3:32pm UTC
Why are you using the .exe extension in a Unix , in fact you don't need a suffix at all.
Last edited on Jun 22, 2014 at 3:32pm UTC
Jun 22, 2014 at 7:08pm UTC
You could let the user link your program against his version of the library
Jun 27, 2014 at 10:45pm UTC
May you should use command "ldconfig" to clear caches of libraries