-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Cannot use statically compiled curl[openssl] in MacOS #7260
Comments
Try finding CURL using: This should pick up the appropriate exported CMake configuration for CURL, including everything required to link successfully. (It's possible that the |
@FerzanVivec Were you able to resolve this? Because I have similar problems with cpr and curl. |
I just rolled back vcpkg to a March version (can't remember which) and my app compiled fine. |
Ah, I see. Maybe I should try that and see what the changes were. |
To amend my earlier post, you will need to both use find_package(CURL CONFIG REQUIRED)
target_link_libraries(main PRIVATE CURL::libcurl) This is instead of using the old |
Thanks, I will give that a try. Just opened a new issue here: #7332 |
Nice, this did indeed work! Thanks a lot! |
I'm unaware of the internals of how cmake works in terms of this bugfix, but when attempting to link to (Also posting this same comment in the linked issue by Toxe in case someone stumbles here from Google like me so they can have a temp fix before the PR comes through.) |
Hi all. Currently, I cannot reproduce this on my machine with the following usage:
Please open a new issue or provide the repro steps and your project case if this is still a problem for you. |
Yeah just add |
Is it missing with cmake or pkg-config? Port curl has received significant work since this issue was closed more than one year ago. |
I use macos10.15.7 also.when I use g++ -lpath/to/vcpkg/lib/libcurl.a,it have the same error like above.but when i use the /usr/lib/libcurl.4.dylib,the error is gone,i don't konw why,but it is a solution. |
@2018DHY curl:x64-osx builds a static library. (x64-osx is static by default.) So you have to take care of transitive usage requirements. That's why you should use CMake package information or pkg-config. |
I'm trying to compile my cross-platform app. Windows version works. Mac version fails when linking. I need curl for cpr package.
Triplet:
package versions:
vcpkg version:
Undefined symbols for architecture x86_64: "_SecCertificateCopyLongDescription", referenced from: _CopyCertSubject in libcurl.a(sectransp.c.o) "_SSLGetNegotiatedProtocolVersion", referenced from: _sectransp_connect_step2 in libcurl.a(sectransp.c.o) "_SecTrustCopyPublicKey", referenced from: _sectransp_connect_step2 in libcurl.a(sectransp.c.o) "_SecTrustSetAnchorCertificates", referenced from: _sectransp_connect_step2 in libcurl.a(sectransp.c.o) "_SecTrustSetAnchorCertificatesOnly", referenced from: _sectransp_connect_step2 in libcurl.a(sectransp.c.o) "_SSLWrite", referenced from: _sectransp_send in libcurl.a(sectransp.c.o) "_SecTrustEvaluate", referenced from: _sectransp_connect_step2 in libcurl.a(sectransp.c.o) "_SSLSetProtocolVersionMax", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SSLCopyALPNProtocols", referenced from: _sectransp_connect_step2 in libcurl.a(sectransp.c.o) "_kSecClass", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SSLSetALPNProtocols", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_kSecReturnRef", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_kSecMatchLimit", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_kSecMatchPolicy", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SecItemCopyMatching", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SecCertificateCreateWithData", referenced from: _append_cert_to_array in libcurl.a(sectransp.c.o) "_SSLRead", referenced from: _sectransp_recv in libcurl.a(sectransp.c.o) "_SSLSetIOFuncs", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SecItemImport", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SecCertificateGetTypeID", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SSLGetNegotiatedCipher", referenced from: _sectransp_connect_step2 in libcurl.a(sectransp.c.o) "_SSLSetPeerDomainName", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_kSecImportItemIdentity", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SecTrustGetCertificateCount", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SecIdentityCreateWithCertificate", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SSLCreateContext", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SSLSetSessionOption", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SSLGetNumberSupportedCiphers", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_kSecAttrLabel", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SSLSetPeerID", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SecPolicyCreateSSL", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SecIdentityCopyCertificate", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SSLSetEnabledCiphers", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SecCertificateCopyCommonName", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SSLSetConnection", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SSLGetSupportedCiphers", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SSLHandshake", referenced from: _sectransp_connect_step2 in libcurl.a(sectransp.c.o) "_SecKeyCopyExternalRepresentation", referenced from: _sectransp_connect_step2 in libcurl.a(sectransp.c.o) "_SSLCopyPeerTrust", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) _sectransp_connect_step2 in libcurl.a(sectransp.c.o) "_SSLSetCertificate", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SecTrustGetCertificateAtIndex", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SSLGetBufferedReadSize", referenced from: _Curl_sectransp_data_pending in libcurl.a(sectransp.c.o) "_kSecClassIdentity", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SSLClose", referenced from: _Curl_sectransp_shutdown in libcurl.a(sectransp.c.o) _Curl_sectransp_close in libcurl.a(sectransp.c.o) "_SSLSetProtocolVersionMin", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_kSecMatchLimitAll", referenced from: _sectransp_connect_common in libcurl.a(sectransp.c.o) "_SSLGetSessionState", referenced from: _Curl_sectransp_check_cxn in libcurl.a(sectransp.c.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
There was no problem when I last build it a couple of months ago.
The text was updated successfully, but these errors were encountered: