w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
how do I solve version conflict that occurs due to multiple version of library inclusion in Linux

Hence When I try to use both of them in my project, I am getting version conflict. Is it expected? If yes, how do I solve this problem?

There are two solutions.

First, you would carry around the versions of libcurl.so & libssl.so you want to use. You would then use the linker's rpath or LD_LIBRARY_PATH to ensure you load the shared objects you included.

Second, you would build your liba.so to statically link against libcurl and libssl.

If you are working on Android, then number two is your choice. That's because OpenSSL is included on Android, zygote loads it, and you always get the downlevel version 0.9.8 after the fork from zygote.

On Android, you would even need to build a wrapper shared object if all you wanted was a modern OpenSSL like 1.0.1 (that looks a lot like what you are experiencing with libcurl.so.3 and libcurl.so.4).

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.