架构 armv7 (WebRTC) 的未定义符号

Posted

技术标签:

【中文标题】架构 armv7 (WebRTC) 的未定义符号【英文标题】:Undefined symbols for architecture armv7 (WebRTC) 【发布时间】:2014-09-05 23:08:36 【问题描述】:

目前我正在 Xcode 6 beta 7 上使用 Swift 为 iPad (ios7) 构建 WebRTC 应用程序。我不断收到这些错误。我添加了错误的库吗?是不是找不到?

这是它打印的错误:

    Undefined symbols for architecture armv7:
  "std::string::_Rep::_S_empty_rep_storage", referenced from:
      +[RTCMediaConstraints constraintsFromArray:] in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
      std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> >::_M_insert_aux(__gnu_cxx::__normal_iterator<webrtc::MediaConstraintsInterface::Constraint*, std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> > >, webrtc::MediaConstraintsInterface::Constraint const&) in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
  "std::string::assign(std::string const&)", referenced from:
      std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> >::_M_insert_aux(__gnu_cxx::__normal_iterator<webrtc::MediaConstraintsInterface::Constraint*, std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> > >, webrtc::MediaConstraintsInterface::Constraint const&) in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
      webrtc::MediaConstraintsInterface::Constraint* std::__copy_backward<false, std::random_access_iterator_tag>::__copy_b<webrtc::MediaConstraintsInterface::Constraint*, webrtc::MediaConstraintsInterface::Constraint*>(webrtc::MediaConstraintsInterface::Constraint*, webrtc::MediaConstraintsInterface::Constraint*, webrtc::MediaConstraintsInterface::Constraint*) in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
      webrtc::MediaConstraintsInterface::Constraint* std::__copy<false, std::random_access_iterator_tag>::copy<webrtc::MediaConstraintsInterface::Constraint*, webrtc::MediaConstraintsInterface::Constraint*>(webrtc::MediaConstraintsInterface::Constraint*, webrtc::MediaConstraintsInterface::Constraint*, webrtc::MediaConstraintsInterface::Constraint*) in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
      webrtc::MediaConstraintsInterface::Constraint* std::__copy<false, std::random_access_iterator_tag>::copy<webrtc::MediaConstraintsInterface::Constraint const*, webrtc::MediaConstraintsInterface::Constraint*>(webrtc::MediaConstraintsInterface::Constraint const*, webrtc::MediaConstraintsInterface::Constraint const*, webrtc::MediaConstraintsInterface::Constraint*) in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
  "std::string::_Rep::_M_destroy(std::allocator<char> const&)", referenced from:
      +[RTCMediaConstraints constraintsFromArray:] in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
      std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> >::_M_insert_aux(__gnu_cxx::__normal_iterator<webrtc::MediaConstraintsInterface::Constraint*, std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> > >, webrtc::MediaConstraintsInterface::Constraint const&) in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)", referenced from:
      __gnu_cxx::new_allocator<webrtc::MediaConstraintsInterface::Constraint>::construct(webrtc::MediaConstraintsInterface::Constraint*, webrtc::MediaConstraintsInterface::Constraint const&) in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
      std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> >::_M_insert_aux(__gnu_cxx::__normal_iterator<webrtc::MediaConstraintsInterface::Constraint*, std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> > >, webrtc::MediaConstraintsInterface::Constraint const&) in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
      webrtc::MediaConstraintsInterface::Constraint::Constraint(std::string const&, std::string) in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
      std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> >::operator=(std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> > const&) in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
      webrtc::MediaConstraintsInterface::Constraint* std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> >::_M_allocate_and_copy<__gnu_cxx::__normal_iterator<webrtc::MediaConstraintsInterface::Constraint const*, std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> > > >(unsigned long, __gnu_cxx::__normal_iterator<webrtc::MediaConstraintsInterface::Constraint const*, std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> > >, __gnu_cxx::__normal_iterator<webrtc::MediaConstraintsInterface::Constraint const*, std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> > >) in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
      std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> >::vector(std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> > const&) in libjingle_peerconnection_objc.a(RTCMediaConstraintsNative.o)
  "std::__throw_length_error(char const*)", referenced from:
      std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> >::_M_insert_aux(__gnu_cxx::__normal_iterator<webrtc::MediaConstraintsInterface::Constraint*, std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> > >, webrtc::MediaConstraintsInterface::Constraint const&) in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()", referenced from:
      __gnu_cxx::new_allocator<webrtc::MediaConstraintsInterface::Constraint>::construct(webrtc::MediaConstraintsInterface::Constraint*, webrtc::MediaConstraintsInterface::Constraint const&) in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
      std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> >::_M_insert_aux(__gnu_cxx::__normal_iterator<webrtc::MediaConstraintsInterface::Constraint*, std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> > >, webrtc::MediaConstraintsInterface::Constraint const&) in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
      webrtc::MediaConstraintsInterface::Constraint::Constraint(std::string const&, std::string) in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
      std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> >::~vector() in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
      std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> >::operator=(std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> > const&) in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
      webrtc::MediaConstraintsInterface::Constraint* std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> >::_M_allocate_and_copy<__gnu_cxx::__normal_iterator<webrtc::MediaConstraintsInterface::Constraint const*, std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> > > >(unsigned long, __gnu_cxx::__normal_iterator<webrtc::MediaConstraintsInterface::Constraint const*, std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> > >, __gnu_cxx::__normal_iterator<webrtc::MediaConstraintsInterface::Constraint const*, std::vector<webrtc::MediaConstraintsInterface::Constraint, std::allocator<webrtc::MediaConstraintsInterface::Constraint> > >) in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)", referenced from:
      +[RTCMediaConstraints constraintsFromArray:] in libjingle_peerconnection_objc.a(RTCMediaConstraints.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

任何帮助都很棒。

【问题讨论】:

【参考方案1】:

我知道这是较旧的,但是...您需要在应用程序的构建设置中的“将二进制文件与库链接”下将 libstdc++.dylib 更改为 libstdc++.6.dylib。烦人,但它对我有用!

【讨论】:

尝试为这个特定架构构建框架。在您的情况下,“armv7”将为您提供一个解决这些错误的框架。 :)

以上是关于架构 armv7 (WebRTC) 的未定义符号的主要内容,如果未能解决你的问题,请参考以下文章

架构 armv7 的未定义符号

架构armv7的未定义符号?

XCode 5 - 架构 armv7 的未定义符号:

架构 armv7s 的未定义符号:iPhoneExtAudioFileConvertTest

静态库链接错误。架构 armv7s 的未定义符号

架构armv7的未定义符号?这个错误是啥意思?