Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MobileVLCKit for iOS fails to build (Both pod and Framework)

When building a project that includes MobileVLCKit the build fails with 76-100 errors from "Undefined symbols for architecture arm64:"

The first few for example:

"std::runtime_error::runtime_error(std::string const&)", referenced from:
      libebml::CRTError::CRTError(std::string const&, int) in MobileVLCKit(StdIOCallback.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)
  "std::basic_ios<char, std::char_traits<char> >::widen(char) const", referenced from:
      dash::mpd::Representation::contextualize(unsigned long, std::string const&, adaptative::playlist::BaseSegmentTemplate const*) const in MobileVLCKit(libdash_plugin_la-Representation.o)

This happens both from the cocoapod, and from the framework downloaded from here: http://nightlies.videolan.org/build/ios/

This errors aren't replicated in their example project here: http://feepk.net/2014/12/02/mobilevlckit-and-vlckit-part-1/

I've checked all linked libraries and linker flags and everything seems to be in order. Thoughts?

like image 826
Mark B Avatar asked Dec 15 '22 13:12

Mark B


2 Answers

I found the problem after looking through so comments on their posts -- the deployment target must be set to 6.1, due to the changes in C++ runtime used in iOS 6.1 and 7.0.

I'll leave this here in case someone else comes across this problem.

If you'd prefer not to change the deployment target you can also add an empty .mm file to force Xcode to link with C++ (via here)

like image 165
Mark B Avatar answered Dec 28 '22 06:12

Mark B


I solved it by replacing libstdc++.dylib with libstdc++.6.0.9.dylib. The deployment target can be set to wanted version in this way. (Reference Link: Chinese blog)

like image 41
NSDeveloper Avatar answered Dec 28 '22 06:12

NSDeveloper