c++ - VLCKit与iOS项目中的.mm文件冲突

标签 c++ ios xcode vlc libvlc

我在我的 iOS 项目中使用 VLCKit (MobileVLCKit.framework)。起初一切都运转良好。然后我添加一些 C++ 代码,因此某些文件是 .mm 文件。当我编译时,它失败了。 Xcode 日志

Undefined symbols for architecture armv7:
  "std::runtime_error::runtime_error(std::string const&)", referenced from:
      libebml::CRTError::CRTError(std::string const&, int) in MobileVLCKit(StdIOCallback.o)
  "std::ostream& std::ostream::_M_insert<void const*>(void const*)", referenced from:
      libebml::IOCallback::writeFully(void const*, unsigned long) in MobileVLCKit(IOCallback.o)
      libebml::IOCallback::readFully(void*, unsigned long) in MobileVLCKit(IOCallback.o)
  "std::runtime_error::runtime_error(std::string const&)", referenced from:
      libebml::IOCallback::writeFully(void const*, unsigned long) in MobileVLCKit(IOCallback.o)
      libebml::IOCallback::readFully(void*, unsigned long) in MobileVLCKit(IOCallback.o)
      "VTT for std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >", referenced from:
...

我不知道为什么以及如何解决这个问题。

最佳答案

我找到了解决方案:在“build设置”中将 C++ 标准库更改为 libstdc++(GNU c++ 标准库)。

关于c++ - VLCKit与iOS项目中的.mm文件冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27559440/

相关文章:

c++ - Visual Studio 2010 C++ 控制台应用程序

c++ - 给定一个单词,通过在它们之间添加空格来形成一个有意义的单词

ios - Google+ 登录崩溃

ios - Xcode 模拟器 - 导航栏丢失

objective-c - Objective C 编辑器调用方法时源文件中的占位符

c++ - Clang 模板不完整类型

c++ - 初始化私有(private)成员静态常量数组

ios - iOS 中主视图/详细 View 中的 subview 管理(使用 ARC)

javascript - 如何在 Protractor 测试中设置 $interval 而不是超时

ios - 如何防止变量被初始化两次?