curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Compiling curl 8.0.1 with OpenSSL 3.1.0 - ../lib/.libs/libcurl.so: undefined reference to ...

From: Jeffrey Walton via curl-library <curl-library_at_lists.haxx.se>
Date: Sun, 16 Apr 2023 13:36:11 -0400

On Sun, Apr 16, 2023 at 1:07 PM Rahul Sabnis via curl-library
<curl-library_at_lists.haxx.se> wrote:
>
> Hello,
>
> I get below errors when I try to compile Curl 8.0.1 with OpenSSL 3.1.0 (Same error with OpenSSL 3.0.8 & 3.0.7)
> ../lib/.libs/libcurl.so: undefined reference to `EVP_PKEY_id'
> ../lib/.libs/libcurl.so: undefined reference to `ENGINE_get_next'
> ../lib/.libs/libcurl.so: undefined reference to `EVP_PKEY_get0_DH'
> ../lib/.libs/libcurl.so: undefined reference to `MD4_Update'
> ../lib/.libs/libcurl.so: undefined reference to `EVP_PKEY_get0_RSA'
> ../lib/.libs/libcurl.so: undefined reference to `ENGINE_get_first'
> ../lib/.libs/libcurl.so: undefined reference to `SSL_get_peer_certificate'
> ../lib/.libs/libcurl.so: undefined reference to `ENGINE_load_private_key'
> ../lib/.libs/libcurl.so: undefined reference to `ENGINE_finish'
> ../lib/.libs/libcurl.so: undefined reference to `ENGINE_get_id'
> ../lib/.libs/libcurl.so: undefined reference to `ENGINE_ctrl_cmd'
> ../lib/.libs/libcurl.so: undefined reference to `EVP_PKEY_get0_DSA'
> ../lib/.libs/libcurl.so: undefined reference to `DSA_get0_key'
> ../lib/.libs/libcurl.so: undefined reference to `RSA_get0_key'
> ../lib/.libs/libcurl.so: undefined reference to `DH_get0_key'
> ../lib/.libs/libcurl.so: undefined reference to `ENGINE_set_default'
> ../lib/.libs/libcurl.so: undefined reference to `DSA_get0_pqg'
> ../lib/.libs/libcurl.so: undefined reference to `ENGINE_free'
> ../lib/.libs/libcurl.so: undefined reference to `MD4_Final'
> ../lib/.libs/libcurl.so: undefined reference to `DH_get0_pqg'
> ../lib/.libs/libcurl.so: undefined reference to `MD4_Init'
> ../lib/.libs/libcurl.so: undefined reference to `ENGINE_ctrl'
> ../lib/.libs/libcurl.so: undefined reference to `ENGINE_by_id'
> ../lib/.libs/libcurl.so: undefined reference to `ENGINE_init'
> collect2: error: ld returned 1 exit status
> make[2]: *** [curl] Error 1
>
> Configure command used:
> ./configure --prefix=/home/builder/curl --enable-http --with-openssl --enable-cookies --enable-shared=yes --enable-static=no --without-zlib --disable-ldap --disable-ldaps --disable-unix-sockets --disable-rtsp --disable-threaded-resolver --disable-ntlm
>
> Configure command output below. Added few other parameters as can be seen below:
> Host setup: x86_64-pc-linux-gnu
> Install prefix: /home/builder/curl
> Compiler: gcc -std=gnu11
> CFLAGS: -fPIC -Werror-implicit-function-declaration -O2 -Wno-system-headers
> CPPFLAGS: -Dlinux26 -isystem /home/builder/openssl/include/openssl -DOPENSSL_NO_DEPRECATED_3_0
> LDFLAGS: -Wl,-R/home/builder/openssl/lib64 -L/home/builder/openssl/lib64
> LIBS: -lssl -lcrypto -ldl
>
> curl version: 8.0.1
> SSL: enabled (OpenSSL)
> SSH: no (--with-{libssh,libssh2})
> zlib: no (--with-zlib)
> brotli: no (--with-brotli)
> zstd: no (--with-zstd)
> GSS-API: no (--with-gssapi)
> GSASL: no (libgsasl not found)
> TLS-SRP: no (--enable-tls-srp)
> resolver: default (--enable-ares / --enable-threaded-resolver)
> IPv6: enabled
> Unix sockets: no (--enable-unix-sockets)
> IDN: no (--with-{libidn2,winidn})
> Build libcurl: Shared=yes, Static=no
> Built-in manual: enabled
> --libcurl option: enabled (--disable-libcurl-option)
> Verbose errors: enabled (--disable-verbose)
> Code coverage: disabled
> SSPI: no (--enable-sspi)
> ca cert bundle: /etc/pki/tls/certs/ca-bundle.crt
> ca cert path: no
> ca fallback: no
> LDAP: no (--enable-ldap / --with-ldap-lib / --with-lber-lib)
> LDAPS: no (--enable-ldaps)
> RTSP: no (--enable-rtsp)
> RTMP: no (--with-librtmp)
> PSL: no (libpsl not found)
> Alt-svc: enabled (--disable-alt-svc)
> Headers API: enabled (--disable-headers-api)
> HSTS: enabled (--disable-hsts)
> HTTP1: enabled (internal)
> HTTP2: no (--with-nghttp2, --with-hyper)
> HTTP3: no (--with-ngtcp2, --with-quiche --with-msh3)
> ECH: no (--enable-ech)
> WebSockets: no (--enable-websockets)
> Protocols: DICT FILE FTP FTPS GOPHER GOPHERS HTTP HTTPS IMAP IMAPS MQTT POP3 POP3S SMTP SMTPS TELNET TFTP
> Features: HSTS HTTPS-proxy IPv6 Largefile SSL alt-svc
>
> Compilation is successful if I use --without-ssl option.
>
> I tried with and withoutthe flag OPENSSL_NO_DEPRECATED_3_0. But no change in result.
>
> Not sure what I am missing here.

For EVP_PKEY_id, the OpenSSL man page says
(https://www.openssl.org/docs/man3.0/man3/EVP_PKEY_id.html):

<SNIP>
The EVP_PKEY_id() and EVP_PKEY_base_id() functions were renamed to
include get in their names in OpenSSL 3.0, respectively. The old names
are kept as non-deprecated alias macros.
</SNIP>

It sounds like you are not compiling against OpenSSL 3.0. You are
compiling against an older OpenSSL that provides the symbol
EVP_PKEY_id, and not the newer OpenSSL that provides the symbol
EVP_PKEY_get_id (with EVP_PKEY_id supplied as a #define).

Please zip cURL's config.log, and attach it to the thread.

Jeff
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-04-16