-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake build failed #12316
Comments
and you did If you do |
I'm sure there is the 3.0.12 version of openssl in '/home/sunyuchang/ttt/openssl-openssl-3.0.12/output', and then I run
|
From
|
yes,just as follows :
|
I was able to reproduce this in Ubuntu 16 LTS with a caveat. Since the default native packaged cmake 3.5.1 is too old to build curl I had to add Kitware's apt repository for xenial and then AFAICT the FindOpenSSL module ( FindOpenSSL.cmake from 3.20.5 I'm not sure if failure to search lib64 is a cmake bug so I've asked about it in their forum. I can think of two ways to work around this and build curl using cmake. The first way is set the pkgconfig path of OpenSSL via
The second way is build and install OpenSSL libs into the lib subdirectory instead of lib64. That is what OpenSSL used to do by default when lib64 subdir does not exist. You can set the directory name by passing
|
The I'd maybe try to do:
here: https://github.com/curl/curl/blob/444f64b3e93bbb0b6a65ffa10c5bb3d1becfc140/CMakeLists.txt#L483C3-L483C33 |
FindOpenSSL.cmake doesn't add lib64 to PATH_SUFFIXES anywhere AFAICS
With
|
Right. I was looking at FindOpenSSL.cmake from 3.27.7. |
@wddsx an easy work-around for you that saves you from having to upgrade your cmake, is to make sure your OpenSSL install uses |
|
Thanks, I missed that. IMO the workarounds we've discussed should be sufficient and this can be closed. |
Case closed. |
I did this
mkdir build
cd build
cmake .. -DOPENSSL_ROOT_DIR:PATH=/home/sunyuchang/ttt/openssl-openssl-3.0.12/output
make -j 64
The results are as follows :
[100%] Building C object src/CMakeFiles/curl.dir/__/lib/warnless.c.o
[100%] Linking C executable curl
../lib/libcurl.so.4.8.0: undefined reference to
OPENSSL_sk_num' ../lib/libcurl.so.4.8.0: undefined reference to
BIO_set_data'../lib/libcurl.so.4.8.0: undefined reference to
X509_get0_notAfter' ../lib/libcurl.so.4.8.0: undefined reference to
BIO_set_init'../lib/libcurl.so.4.8.0: undefined reference to
OpenSSL_version' ../lib/libcurl.so.4.8.0: undefined reference to
OPENSSL_init_ssl'../lib/libcurl.so.4.8.0: undefined reference to
X509_STORE_load_file' ../lib/libcurl.so.4.8.0: undefined reference to
EVP_PKEY_get_id'../lib/libcurl.so.4.8.0: undefined reference to
BIO_meth_free' ../lib/libcurl.so.4.8.0: undefined reference to
BIO_get_shutdown'../lib/libcurl.so.4.8.0: undefined reference to
SSL_CTX_set_keylog_callback' ../lib/libcurl.so.4.8.0: undefined reference to
X509_STORE_up_ref'../lib/libcurl.so.4.8.0: undefined reference to
OPENSSL_sk_pop_free' ../lib/libcurl.so.4.8.0: undefined reference to
SSL_get1_peer_certificate'../lib/libcurl.so.4.8.0: undefined reference to
OPENSSL_sk_pop' ../lib/libcurl.so.4.8.0: undefined reference to
OPENSSL_sk_value'../lib/libcurl.so.4.8.0: undefined reference to
BIO_meth_set_destroy' ../lib/libcurl.so.4.8.0: undefined reference to
BIO_meth_set_write'../lib/libcurl.so.4.8.0: undefined reference to
BIO_meth_set_read' ../lib/libcurl.so.4.8.0: undefined reference to
SSL_CTX_set_post_handshake_auth'../lib/libcurl.so.4.8.0: undefined reference to
X509_get0_extensions' ../lib/libcurl.so.4.8.0: undefined reference to
SSL_CTX_set_options'../lib/libcurl.so.4.8.0: undefined reference to
SSL_CTX_set_ciphersuites' ../lib/libcurl.so.4.8.0: undefined reference to
EVP_MD_CTX_free'../lib/libcurl.so.4.8.0: undefined reference to
X509_get_X509_PUBKEY' ../lib/libcurl.so.4.8.0: undefined reference to
X509_get_version'../lib/libcurl.so.4.8.0: undefined reference to
TLS_client_method' ../lib/libcurl.so.4.8.0: undefined reference to
X509_get0_notBefore'../lib/libcurl.so.4.8.0: undefined reference to
BIO_get_data' ../lib/libcurl.so.4.8.0: undefined reference to
X509_STORE_load_path'../lib/libcurl.so.4.8.0: undefined reference to
BIO_set_shutdown' ../lib/libcurl.so.4.8.0: undefined reference to
BIO_meth_new'../lib/libcurl.so.4.8.0: undefined reference to
EVP_MD_CTX_new' ../lib/libcurl.so.4.8.0: undefined reference to
BIO_meth_set_create'../lib/libcurl.so.4.8.0: undefined reference to
EVP_PKEY_get_bn_param' ../lib/libcurl.so.4.8.0: undefined reference to
ASN1_STRING_get0_data'../lib/libcurl.so.4.8.0: undefined reference to `BIO_meth_set_ctrl'
collect2: error: ld returned 1 exit status
src/CMakeFiles/curl.dir/build.make:811: recipe for target 'src/curl' failed
make[2]: *** [src/curl] Error 1
CMakeFiles/Makefile2:229: recipe for target 'src/CMakeFiles/curl.dir/all' failed
make[1]: *** [src/CMakeFiles/curl.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
I expected the following
build success
curl/libcurl version
openssl 3.0.12
curl 8.4.0
operating system
ubuntu16.04
The text was updated successfully, but these errors were encountered: