C library version conflicts, how to manage?

I am making a C application. In the assembly, I indicate

LIBS=-lcrypto -lcurl

A warning message appears,

/usr/bin/ld: warning: libcrypto.so.1.0.2, needed by /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libcurl.so, may conflict with libcrypto.so.1.1

By default, -lcrypto is related to version 1.1. Libcurl is dependent on version 1.0.2. I make him quiet like

LIBS=/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2  -lcurl

But then the functionality in the included header #include <openssl/crypto.h>betrays the associated version. The header is related to version 1.1, not 1.0.2.

I want tips on how to manage the problem. I rely on the CURL system library, but it depends on the version of OpenSSL that I don't want. What to do?

Edit: Clarification: I do not want to recompile CURL if this helps. Is this a common scenario of "dependent hell"?

Edit 2: Tracking my files so I find this,

$ dpkg --list | grep libssl1
ii  libssl1.0.0:amd64                     1.0.1t-1+deb8u6                      amd64        Secure Sockets Layer toolkit - shared libraries
ii  libssl1.0.2:amd64                     1.0.2k-1                             amd64        Secure Sockets Layer toolkit - shared libraries
ii  libssl1.1:amd64                       1.1.0e-1                             amd64        Secure Sockets Layer toolkit - shared libraries

$ apt-file list libssl1.0.0
# Nobody! Strange?
$ apt-file list libssl1.0.2 | grep libcrypto
libssl1.0.2: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2
$ apt-file list libssl1.1 | grep libcrypto
libssl1.1: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
$ ls -l /usr/lib/x86_64-linux-gnu/*libcrypto*
-rw-r--r-- 1 root root 4799548 Feb 16 17:57 /usr/lib/x86_64-linux-gnu/libcrypto.a
lrwxrwxrwx 1 root root      16 Feb 16 17:57 /usr/lib/x86_64-linux-gnu/libcrypto.so -> libcrypto.so.1.1
-rw-r--r-- 1 root root 2066816 Jan 26 23:40 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
-rw-r--r-- 1 root root 2492192 Jan 26 15:39 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2
-rw-r--r-- 1 root root 2686448 Feb 16 17:57 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
$ ls -l /usr/lib/x86_64-linux-gnu/*libcurl*
-rw-r--r-- 1 root root 1059312 Feb 21 22:38 /usr/lib/x86_64-linux-gnu/libcurl.a
lrwxrwxrwx 1 root root      19 Feb 21 22:38 /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.3 -> libcurl-gnutls.so.4
lrwxrwxrwx 1 root root      23 Feb 21 22:38 /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 -> libcurl-gnutls.so.4.4.0
-rw-r--r-- 1 root root  518560 Feb 21 22:38 /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.4.0
-rw-r--r-- 1 root root     951 Feb 21 22:38 /usr/lib/x86_64-linux-gnu/libcurl.la
lrwxrwxrwx 1 root root      16 Feb 21 22:38 /usr/lib/x86_64-linux-gnu/libcurl.so -> libcurl.so.4.4.0
lrwxrwxrwx 1 root root      12 Feb 21 22:38 /usr/lib/x86_64-linux-gnu/libcurl.so.3 -> libcurl.so.4
lrwxrwxrwx 1 root root      16 Feb 21 22:38 /usr/lib/x86_64-linux-gnu/libcurl.so.4 -> libcurl.so.4.4.0
$ ldd /usr/lib/x86_64-linux-gnu/libcurl.so | grep libcrypto
    libcrypto.so.1.0.2 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2 (0x00007fd97750a000)

, , Debian 1.0.2. apt-cache showpkg libssl1.0.2 . 1.1, , Debian .

+4
1

, Debian 8 (jessie) Debian 9 (). , , :

apt-get install libssl1.0-dev
+2

Source: https://habr.com/ru/post/1674381/


All Articles