【发布时间】:2022-11-09 22:18:02
【问题描述】:
我从源代码下载并编译 openssl 3.0.2 并希望将其与 libcurl 链接苹果系统,但是,我遇到一些问题,我使用最新的 libcurl 7.82.0。
下面是配置。
./configure --prefix="$(pwd)/curl" --with-ssl=/Users/test/Downloads/openssl-openssl-3.0.2/openssl --enable-static --disable-shared --disable -ftp --disable-file --disable-ldap --disable-dict --disable-telnet --disable-tftp --disable-rtsp --disable-pop3 --disable-imap --disable-smtp --disable -gopher --disable-ares --disable-debug --with-zlib=/Users/test/Downloads/zlib-1.2.11/zlib --without-libidn --without-brotli --without-zstd --without -nghttp2 --without-librtmp --without-libidn2 --without-winidn
并且配置结果看起来不错,openssl 包含文件夹已设置。
Host setup: x86_64-apple-darwin20.6.0 Install prefix: /Users/test/Downloads/curl-7.82.0/curl Compiler: gcc CFLAGS: -Qunused-arguments -Wno-pointer-bool-conversion -Os -Werror=partial-availability -pthread CPPFLAGS: -isystem /Users/test/Downloads/zlib-1.2.11/zlib/include -isystem /Users/test/Downloads/openssl-openssl-3.0.2/openssl/include -DOPENSSL_SUPPRESS_DEPRECATED LDFLAGS: -framework CoreFoundation -framework SystemConfiguration -L/Users/test/Downloads/zlib-1.2.11/zlib/lib -L/Users/test/Downloads/openssl-openssl-3.0.2/openssl/lib LIBS: -lssl -lcrypto -lssl -lcrypto -lz curl version: 7.82.0 SSL: enabled (OpenSSL v3+)但是make的时候会输出错误:
Undefined symbols for architecture x86_64: "_EVP_PKEY_id", referenced from: _ossl_connect_common in libcurl.a(libcurl_la-openssl.o) "_SSL_get_peer_certificate", referenced from: _ossl_connect_common in libcurl.a(libcurl_la-openssl.o) ld: symbol(s) not found for architecture x86_64测试: 我发现 os 在 /usr/local/include/openssl 安装了 openssl1.1.1m, 删除此文件夹后,错误已修复。所以我认为系统安装的openssl头文件在libcurl make中受到影响。
我想我已经将 libcurl 配置为使用/Users/test/Downloads/openssl-openssl-3.0.2/openssl/include,但它不起作用。
提前致谢。
【问题讨论】:
标签: libcurl