[英]Linker errors when compiling libgit2 static Library
我已通过以下步骤为OSX成功构建了跨平台静态库:
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=OFF "-DCMAKE_OSX_ARCHITECTURES=x86_64;i386" ..
cmake --build .
我也成功地将该库链接到了自己的项目中,但是现在在XCode 5.1.1中遇到了大量有关缺少符号的链接器错误:
Undefined symbols for architecture x86_64:
"_SSLClose", referenced from:
_stransport_close in libVAST.a(stransport_stream.c.o)
"_SSLCopyPeerTrust", referenced from:
_stransport_connect in libVAST.a(stransport_stream.c.o)
_stransport_certificate in libVAST.a(stransport_stream.c.o)
"_SSLCreateContext", referenced from:
_git_stransport_stream_new in libVAST.a(stransport_stream.c.o)
"_SSLHandshake", referenced from:
_stransport_connect in libVAST.a(stransport_stream.c.o)
"_SSLRead", referenced from:
_stransport_read in libVAST.a(stransport_stream.c.o)
"_SSLSetConnection", referenced from:
_git_stransport_stream_new in libVAST.a(stransport_stream.c.o)
"_SSLSetIOFuncs", referenced from:
_git_stransport_stream_new in libVAST.a(stransport_stream.c.o)
"_SSLSetPeerDomainName", referenced from:
_git_stransport_stream_new in libVAST.a(stransport_stream.c.o)
"_SSLSetProtocolVersionMax", referenced from:
_git_stransport_stream_new in libVAST.a(stransport_stream.c.o)
"_SSLSetProtocolVersionMin", referenced from:
_git_stransport_stream_new in libVAST.a(stransport_stream.c.o)
"_SSLSetSessionOption", referenced from:
_git_stransport_stream_new in libVAST.a(stransport_stream.c.o)
"_SSLWrite", referenced from:
_stransport_write in libVAST.a(stransport_stream.c.o)
"_SecCertificateCopyData", referenced from:
_stransport_certificate in libVAST.a(stransport_stream.c.o)
"_SecCopyErrorMessageString", referenced from:
_stransport_error in libVAST.a(stransport_stream.c.o)
"_SecTrustEvaluate", referenced from:
_stransport_connect in libVAST.a(stransport_stream.c.o)
" _SecTrustGetCertificateAtIndex", referenced from:
_stransport_certificate in libVAST.a(stransport_stream.c.o)
...
...
等等。
我想我那里缺少一个额外的步骤或依赖项,并且我得到了一些暗示,鉴于这个git-hub线程在rust上并不是完全没有先例的,( https://github.com/rust-lang/ cargo / issues / 2295 ),但我不确定如何继续。 有什么想法吗?
最可能的原因是OSX和libgit2的旧版本。 某些版本的libgit2假定OSX / macOS上的安全框架始终提供SecureTransport(该库提供您缺少的加密/ TLS符号)。
对于较旧的操作系统,情况并非如此。 该问题已在2015年底修复,而该修复程序包含在v0.24版本系列以及v0.23.2中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.