Linking issue due to so version number

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

Long shot - Check the contents of /etc/ld.so.conf and run ldconfig to update the shared library symbolic links.

1 Like

I have this linking issue somewhere in the past. The guy is right you should check the contents.

Linking statically is one way to get around portability issues like this. The executable image file is larger but not dependent on what libraries reside on the destination machine.

Link Options - Using the GNU Compiler Collection (GCC)

Also check your LD_LIBRARY_PATH and LD_RUN_PATH envvals on both machines.