Search code examples
c++iosxcodevlclibvlc

VLCKit conflict with .mm file in iOS project


I'm using VLCKit (MobileVLCKit.framework) in my iOS project. At first everything works well. Then I add some C++ code, so some file are .mm files. When I compile, it failed. Xcode log

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:
...

I don't know why and how to solve this problem.


Solution

  • I found the solution: Change C++ Standard Library to libstdc++ (GNU c++ standard library) in the Build Settings.