Search code examples
iosxcodelinkerlinker-errorsmach-o

mach-o linker errors with metaio


I am working with Metaio SDK and cloud plugin and I can not get past a huge collection of mach-o linker errors in xcode 5. Here are a few, but I have 118 of them:

Undefined symbols for architecture armv7s:
  "std::__throw_logic_error(char const*)", referenced from:
      tesseract::WordListLangModel::AddString32(int const*) in metaioSDK(word_list_lang_model.o)
      std::basic_string<int, std::char_traits<int>, std::allocator<int> >::basic_string(std::basic_string<int, std::char_traits<int>, std::allocator<int> > const&, unsigned long, unsigned long) in metaioSDK(word_list_lang_model.o)
      tesseract::ConvNetCharKSBmHGiVwS::Fold() in metaioSDK(conv_net_classifier.o)
      tesseract::HybridNeuralNetCharKSBmHGiVwS::Fold() in metaioSDK(hybrid_neural_net_classifier.o)
  "std::string::operator[](unsigned long) const", referenced from:
      tesseract::CubeUtils::SplitStringUsing(std::string const&, std::string const&, std::vector<std::string, std::allocator<std::string> >*) in metaioSDK(cube_utils.o)
  "std::string::find_first_of(std::string const&, unsigned long) const", referenced from:
      tesseract::CubeUtils::SplitStringUsing(std::string const&, std::string const&, std::vector<std::string, std::allocator<std::string> >*) in metaioSDK(cube_utils.o)
  "std::string::length() const", referenced from:
      tesseract::WordUnigrams::Create(std::string const&, std::string const&) in metaioSDK(word_unigrams.o)
      tesseract::TesseractCubeCombiner::ComputeCombinerFeatures(std::string const&, int, tesseract::CubeObject*, tesseract::WordAltList*, std::vector<double, std::allocator<double> >*, bool*) in metaioSDK(tesseract_cube_combiner.o)
      tesseract::ConvNetCharKSBmHGiVwS::LoadFoldingSets(std::string const&, std::string const&, tesseract::LangModel*) in metaioSDK(conv_net_classifier.o)
      tesseract::HybridNeuralNetCharKSBmHGiVwS::LoadFoldingSets(std::string const&, std::string const&, tesseract::LangModel*) in metaioSDK(hybrid_neural_net_classifier.o)

After setting deployment target to 6.0, I have cut this down to 6 errors

Undefined symbols for architecture armv7s:
  "_OBJC_CLASS_$_EKEventEditViewController", referenced from:
      objc-class-ref in metaioSDK(XDtLkdmsHtXjGTCxiIGVbMqenrFYqNevtLOSg)
  "_OBJC_CLASS_$_EKEvent", referenced from:
      objc-class-ref in metaioSDK(XDtLkdmsHtXjGTCxiIGVbMqenrFYqNevtLOSg)
  "_OBJC_METACLASS_$_MPMoviePlayerViewController", referenced from:
      _OBJC_METACLASS_$_ASMoviePlayerViewController in metaioSDK(ASMoviePlayerViewController.o)
      _OBJC_METACLASS_$_MoviePlayerViewController in metaioSDK(MoviePlayerViewController.o)
  "_OBJC_CLASS_$_EKEventStore", referenced from:
      objc-class-ref in metaioSDK(XDtLkdmsHtXjGTCxiIGVbMqenrFYqNevtLOSg)
  "_OBJC_CLASS_$_MPMoviePlayerViewController", referenced from:
      _OBJC_CLASS_$_ASMoviePlayerViewController in metaioSDK(ASMoviePlayerViewController.o)
      _OBJC_CLASS_$_MoviePlayerViewController in metaioSDK(MoviePlayerViewController.o)
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Solution

  • The error you shown for iOS 6 means, that some of the frameworks are missing, Please add all these frameworks shown in the image to make it work with iOS 6.

    enter image description here

    and this link can help you as well.

    New Update:

    After checking your code, i found some problems in the your project, You were missing the StoreKit and StoreKitUI and MeidaPlayer Frameworks.

    And some of your build setting configuration was not correct. Please use the exact configurations show in this images. Other Linker flag must be like that:

    enter image description here

    and C Language dialect must be like that: enter image description here

    and this configuration be exactly like this image: enter image description here

    i have tested the your app by using all these configuration and now the app is working fine with iOS7 and iOS 6.