Search code examples
linuxsslshared-librariesversionld

ssl version conflict when linking


I have one binary that need boost and mysqlconnector so when linking.

But boost depends on libssl.so.1.0.1, while mysqlconnector depends on libssl.so.1.1

When linking, I got the following warning.

/usr/bin/ld: warning: libssl.so.1.1, needed by //usr/lib/x86_64-linux-gnu/libmysqlcppconn.so.7, may conflict with libssl.so.1.0.0

I would like to tell mysqlconnector to link against libssl.so.1.1 while boost link to libssl.so.1.0.1.

Is there any way to do so ?


Solution

  • I would like to tell mysqlconnector to link against libssl.so.1.1 while boost link to libssl.so.1.0.1.

    Is there any way to do so ?

    This is already happening (which is what the linker is warning you about).

    The end result is a program that may appear to work, or may crash. If it appears to work today, it may start crashing tomorrow, for seemingly unrelated changes to the system. In other words, this path leads to insanity.

    What you should do is get a consistent build environment. That is, decide which of libssl.so.1.1 or libssl.so.1.0.1 you are going to use, and then either build or otherwise obtain libmysqlconnector.so and libbost.so which both use the same version of libssl.