首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >与C++库在iOS项目上的链接失败

与C++库在iOS项目上的链接失败
EN

Stack Overflow用户
提问于 2014-01-30 17:46:17
回答 1查看 579关注 0票数 1

我试图链接到利布宁,遵循说明,但我似乎无法链接到C++标准库。

Other linker flags设置为-lstdc++ -all_load (正如您可以看到的这里),但是它似乎找不到C++函数:这里

知道我可能错过了什么吗?

谢谢。

编辑:@Speeder问道,下面是完整的日志:

代码语言:javascript
复制
Ld /Users/Maxime/Library/Developer/Xcode/DerivedData/OrangeTV-gjzdhpgbpshbbndllvftwfurgmek/Build/Products/Debug-iphonesimulator/OrangeTV.app/OrangeTV normal x86_64
cd /Users/Maxime/Documents/OrangeTV/OrangeTV
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/Maxime/Library/Developer/Xcode/DerivedData/OrangeTV-gjzdhpgbpshbbndllvftwfurgmek/Build/Products/Debug-iphonesimulator -L../Third-Party -L../Third-Party/upnpx -L../Third-Party/upnpx/api -L../Third-Party/upnpx/common -L../Third-Party/upnpx/eventserver -L../Third-Party/upnpx/generator -L../Third-Party/upnpx/port -L../Third-Party/upnpx/ssdp -L../Third-Party/upnpx/upnp -L../Third-Party/upnpx/port/ios -L../Third-Party/upnpx/port/macos -F/Users/Maxime/Library/Developer/Xcode/DerivedData/OrangeTV-gjzdhpgbpshbbndllvftwfurgmek/Build/Products/Debug-iphonesimulator -filelist /Users/Maxime/Library/Developer/Xcode/DerivedData/OrangeTV-gjzdhpgbpshbbndllvftwfurgmek/Build/Intermediates/OrangeTV.build/Debug-iphonesimulator/OrangeTV.build/Objects-normal/x86_64/OrangeTV.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -lstdc++ -all_load -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -lupnpx -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/Maxime/Library/Developer/Xcode/DerivedData/OrangeTV-gjzdhpgbpshbbndllvftwfurgmek/Build/Intermediates/OrangeTV.build/Debug-iphonesimulator/OrangeTV.build/Objects-normal/x86_64/OrangeTV_dependency_info.dat -o /Users/Maxime/Library/Developer/Xcode/DerivedData/OrangeTV-gjzdhpgbpshbbndllvftwfurgmek/Build/Products/Debug-iphonesimulator/OrangeTV.app/OrangeTV

Undefined symbols for architecture x86_64:
"std::string::find(char const*, unsigned long) const", referenced from:
  SSDPSearchResp::Process(sockaddr*, std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*> >) in libupnpx.a(ssdpsearchresp.o)
  SSDPNotifyAlive::Process(sockaddr*, std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*> >) in libupnpx.a(ssdpnotifyalive.o)
"std::string::c_str() const", referenced from:
  BasicHTTPObserver_wrapper::CanProcessMethod(std::string*) in libupnpx.a(BasicHTTPServer_ObjC.o)
  BasicHTTPObserver_wrapper::Request(char*, unsigned short, std::string*, std::string*, std::string*, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >*, char*, int) in libupnpx.a(BasicHTTPServer_ObjC.o)
  -[SSDPDBDevice_ObjC initWithCPPDevice:] in libupnpx.a(SSDPDB_ObjC.o)
  SSDP::Search() in libupnpx.a(ssdp.o)
  SSDPDB::DeleteDevice(unsigned char*, unsigned int) in libupnpx.a(ssdpdb.o)
  SSDPDB::DeleteDevicesByUuid(unsigned char*, unsigned int) in libupnpx.a(ssdpdb.o)
  SSDPDB::GetDevice(unsigned char*, unsigned int) in libupnpx.a(ssdpdb.o)
  ...
"std::string::length() const", referenced from:
  SSDPDB::DeleteDevice(unsigned char*, unsigned int) in libupnpx.a(ssdpdb.o)
  SSDPDB::DeleteDevicesByUuid(unsigned char*, unsigned int) in libupnpx.a(ssdpdb.o)
  SSDPDB::GetDevice(unsigned char*, unsigned int) in libupnpx.a(ssdpdb.o)
  SSDPDB::UpdateCacheControl(unsigned char*, unsigned int, int) in libupnpx.a(ssdpdb.o)
"std::string::compare(std::string const&) const", referenced from:
  bool std::operator<<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libupnpx.a(httpsession.o)
  bool std::operator<<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libupnpx.a(BasicHTTPServer_ObjC.o)
  bool std::operator<<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libupnpx.a(basichttpserver.o)
"std::allocator<char>::allocator()", referenced from:
  SSDP::SSDP() in libupnpx.a(ssdp.o)
  BasicHTTPServer::DataReceived(sockaddr_in*, int, unsigned char*) in libupnpx.a(basichttpserver.o)
"std::allocator<char>::~allocator()", referenced from:
  SSDP::SSDP() in libupnpx.a(ssdp.o)
  BasicHTTPServer::DataReceived(sockaddr_in*, int, unsigned char*) in libupnpx.a(basichttpserver.o)
"std::string::assign(char const*, unsigned long)", referenced from:
  SSDPSearchResp::Process(sockaddr*, std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*> >) in libupnpx.a(ssdpsearchresp.o)
  SSDPDB::InsertDevice(unsigned char*, unsigned int) in libupnpx.a(ssdpdb.o)
  SSDPNotifyAlive::Process(sockaddr*, std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*> >) in libupnpx.a(ssdpnotifyalive.o)
"std::string::replace(unsigned long, unsigned long, char const*)", referenced from:
  SSDPSearchResp::Process(sockaddr*, std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*> >) in libupnpx.a(ssdpsearchresp.o)
  SSDPNotifyAlive::Process(sockaddr*, std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*> >) in libupnpx.a(ssdpnotifyalive.o)
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)", referenced from:
  SSDP::SSDP() in libupnpx.a(ssdp.o)
  BasicHTTPServer::DataReceived(sockaddr_in*, int, unsigned char*) in libupnpx.a(basichttpserver.o)
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)", referenced from:
  std::pair<std::string const, std::string>::pair(std::string const&, std::string const&) in libupnpx.a(httpsession.o)
  std::pair<std::string const, std::string>::pair(std::pair<std::string const, std::string> const&) in libupnpx.a(httpsession.o)
  std::pair<std::string const, std::string>::pair(std::string const&, std::string const&) in libupnpx.a(BasicHTTPServer_ObjC.o)
  std::pair<std::string const, std::string>::pair(std::pair<std::string const, std::string> const&) in libupnpx.a(BasicHTTPServer_ObjC.o)
  std::pair<std::string const, HTTPSession*>::pair(std::string const&, HTTPSession* const&) in libupnpx.a(basichttpserver.o)
  std::pair<std::string const, HTTPSession*>::pair(std::pair<std::string const, HTTPSession*> const&) in libupnpx.a(basichttpserver.o)
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()", referenced from:
  HTTPSession::HTTPSession(char*, unsigned short) in libupnpx.a(httpsession.o)
  HTTPSession::ParseHeader(unsigned char*, int) in libupnpx.a(httpsession.o)
  std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::operator[](std::string const&) in libupnpx.a(httpsession.o)
  BasicHTTPObserver_wrapper::Response(int*, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >*, char**, int*) in libupnpx.a(BasicHTTPServer_ObjC.o)
  std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::operator[](std::string const&) in libupnpx.a(BasicHTTPServer_ObjC.o)
  ___cxx_global_var_init in libupnpx.a(ssdp.o)
  ___cxx_global_var_init9 in libupnpx.a(ssdp.o)
  ...
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()", referenced from:
  HTTPSession::HTTPSession(char*, unsigned short) in libupnpx.a(httpsession.o)
  HTTPSession::~HTTPSession() in libupnpx.a(httpsession.o)
  HTTPSession::ParseHeader(unsigned char*, int) in libupnpx.a(httpsession.o)
  std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::operator[](std::string const&) in libupnpx.a(httpsession.o)
  std::pair<std::string const, std::string>::~pair() in libupnpx.a(httpsession.o)
  std::pair<std::string const, std::string>::pair(std::string const&, std::string const&) in libupnpx.a(httpsession.o)
  std::pair<std::string const, std::string>::pair(std::pair<std::string const, std::string> const&) in libupnpx.a(httpsession.o)
  ...
"std::string::operator=(char const*)", referenced from:
  HTTPSession::ParseHeader(unsigned char*, int) in libupnpx.a(httpsession.o)
  BasicHTTPObserver_wrapper::Response(int*, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >*, char**, int*) in libupnpx.a(BasicHTTPServer_ObjC.o)
  SSDP::SetOS(char const*) in libupnpx.a(ssdp.o)
  SSDP::SetProduct(char const*) in libupnpx.a(ssdp.o)
  SSDPDBDevice::SSDPDBDevice() in libupnpx.a(ssdpdbdevice.o)
"std::string::operator=(std::string const&)", referenced from:
  HTTPSession::ParseHeader(unsigned char*, int) in libupnpx.a(httpsession.o)
  BasicHTTPObserver_wrapper::Response(int*, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >*, char**, int*) in libupnpx.a(BasicHTTPServer_ObjC.o)
"std::_Rb_tree_decrement(std::_Rb_tree_node_base*)", referenced from:
  std::_Rb_tree_iterator<std::pair<std::string const, std::string> >::operator--() in libupnpx.a(httpsession.o)
  std::_Rb_tree_iterator<std::pair<std::string const, std::string> >::operator--() in libupnpx.a(BasicHTTPServer_ObjC.o)
  std::_Rb_tree_iterator<std::pair<std::string const, HTTPSession*> >::operator--() in libupnpx.a(basichttpserver.o)
"std::_Rb_tree_increment(std::_Rb_tree_node_base const*)", referenced from:
  std::_Rb_tree_const_iterator<std::pair<std::string const, std::string> >::operator++(int) in libupnpx.a(BasicHTTPServer_ObjC.o)
"std::_Rb_tree_increment(std::_Rb_tree_node_base*)", referenced from:
  std::_Rb_tree_iterator<std::pair<std::string const, std::string> >::operator++() in libupnpx.a(httpsession.o)
  std::_Rb_tree_iterator<std::pair<std::string const, std::string> >::operator++() in libupnpx.a(BasicHTTPServer_ObjC.o)
  std::_Rb_tree_iterator<std::pair<std::string const, HTTPSession*> >::operator++(int) in libupnpx.a(basichttpserver.o)
  std::_Rb_tree_iterator<std::pair<std::string const, HTTPSession*> >::operator++() in libupnpx.a(basichttpserver.o)
"std::__throw_length_error(char const*)", referenced from:
  std::vector<SSDPObserver*, std::allocator<SSDPObserver*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<SSDPObserver**, std::vector<SSDPObserver*, std::allocator<SSDPObserver*> > >, SSDPObserver* const&) in libupnpx.a(ssdp.o)
  std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<SSDP_HTTP_HEADER**, std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*> > >, SSDP_HTTP_HEADER* const&) in libupnpx.a(ssdpmessage.o)
  std::vector<BasicHTTPObserver*, std::allocator<BasicHTTPObserver*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<BasicHTTPObserver**, std::vector<BasicHTTPObserver*, std::allocator<BasicHTTPObserver*> > >, BasicHTTPObserver* const&) in libupnpx.a(basichttpserver.o)
  std::vector<SocketServerConnection*, std::allocator<SocketServerConnection*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<SocketServerConnection**, std::vector<SocketServerConnection*, std::allocator<SocketServerConnection*> > >, SocketServerConnection* const&) in libupnpx.a(socketserver.o)
  std::vector<SocketServerObserver*, std::allocator<SocketServerObserver*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<SocketServerObserver**, std::vector<SocketServerObserver*, std::allocator<SocketServerObserver*> > >, SocketServerObserver* const&) in libupnpx.a(socketserver.o)
  std::vector<SSDPDBObserver*, std::allocator<SSDPDBObserver*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<SSDPDBObserver**, std::vector<SSDPDBObserver*, std::allocator<SSDPDBObserver*> > >, SSDPDBObserver* const&) in libupnpx.a(ssdpdb.o)
  std::vector<SSDPDBDevice*, std::allocator<SSDPDBDevice*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<SSDPDBDevice**, std::vector<SSDPDBDevice*, std::allocator<SSDPDBDevice*> > >, SSDPDBDevice* const&) in libupnpx.a(ssdpdb.o)
  ...
"std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", referenced from:
  std::_Rb_tree<std::string, std::pair<std::string const, HTTPSession*>, std::_Select1st<std::pair<std::string const, HTTPSession*> >, std::less<std::string>, std::allocator<std::pair<std::string const, HTTPSession*> > >::erase(std::_Rb_tree_iterator<std::pair<std::string const, HTTPSession*> >) in libupnpx.a(basichttpserver.o)
"std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", referenced from:
  std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<std::string const, std::string> const&) in libupnpx.a(httpsession.o)
  std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<std::string const, std::string> const&) in libupnpx.a(BasicHTTPServer_ObjC.o)
  std::_Rb_tree<std::string, std::pair<std::string const, HTTPSession*>, std::_Select1st<std::pair<std::string const, HTTPSession*> >, std::less<std::string>, std::allocator<std::pair<std::string const, HTTPSession*> > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<std::string const, HTTPSession*> const&) in libupnpx.a(basichttpserver.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-02-13 10:53:02

我知道这不是真正的答案,但我最终使用Cocoapods导入了库。真不敢相信我以前还没检查过它是否可用呢!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21463774

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档