C++ 编译libgit2静态库时发生链接器错误

C++ 编译libgit2静态库时发生链接器错误,c++,libgit2,C++,Libgit2,我已经通过以下步骤成功地为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: "_SSLClo

我已经通过以下步骤成功地为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线程已经生锈了,(),但我不完全确定如何继续。想法?

最可能的原因是OSX和libgit2的旧版本。某些版本的libgit2假定OSX/macOS上的安全框架始终提供SecureTransport(提供您缺少的加密/TLS符号的库)

对于较旧的操作系统,情况并非如此。这在2015年末得到了修复,该修复包含在v0.24版本系列以及v0.23.2中