Search code examples
iosobjective-cxcodelinkermach-o

Apple Mach-O Linker Error with third party SDK


I've gone through all the Mach-O linker error entries in stackoverflow but could not solve the issue. Please refer to the following information :

  1. I am using a third party SDK framework in my application.
  2. XCode 5.1, iOS7.1 SDK, iPad Application
  3. Mach-O linker error arises from the addition of the SDK.
  4. I tested with two different projects;
    1. SDK provider's sample app. BULIDS FINE AND COMPILES FINE; Search path is empty, the SDK framework is within the project directory, Don't Create Position Independent Executables:YES, Mach-O Type:Executable
  5. Created a different app from scratch, THROWS MACH-O LINKER ERROR;Search path is empty, the SDK framework is within the project directory, Don't Create Position Independent Executables:YES, Mach-O Type:Executable. I added all the frameworks in the sample app, also imported all the class and header files I needed from it.
  6. If I remove search path, it can not discover the SDK framework, so I have to add it again.

    Undefined symbols for architecture i386:
    "std::string::find_last_of(char const*, unsigned long) const", referenced from:
    talk_base::Pathname::SetPathname(std::string const&) in ACBClientSDK(pathutils.o)
    talk_base::Pathname::folder_name() const in ACBClientSDK(pathutils.o)
    talk_base::Pathname::parent_folder() const in ACBClientSDK(pathutils.o)
    "std::string::find_last_of(char, unsigned long) const", referenced from:
    buzz::SuggestPrefix(std::string const&) in ACBClientSDK(xmlnsstack.o)
    "std::string::find_first_of(char const*, unsigned long) const", referenced from:
    webrtc::DtmfSender::DoInsertDtmf() in ACBClientSDK(dtmfsender.o)
    talk_base::Pathname::SetBasename(std::string const&) in ACBClientSDK(pathutils.o)
    talk_base::Pathname::SetExtension(std::string const&) in ACBClientSDK(pathutils.o)
    buzz::XmlPrinterImpl::PrintQuotedValue(std::string const&) in   ACBClientSDK(xmlprinter.o)
    buzz::XmlPrinterImpl::PrintBodyText(std::string const&) in ACBClientSDK(xmlprinter.o)
    "std::string::find_first_of(char, unsigned long) const", referenced from:
    talk_base::Pathname::SetExtension(std::string const&) in ACBClientSDK(pathutils.o)
    "std::string::find_last_not_of(char const*, unsigned long) const", referenced from:
    talk_base::string_trim(std::string const&) in ACBClientSDK(stringutils.o)
    "std::string::find_first_not_of(char const*, unsigned long) const", referenced from:
    talk_base::string_trim(std::string const&) in ACBClientSDK(stringutils.o)
    

How can I solve the issue? Looking forward to your responses! Thanks in advance!


Solution

  • I just had the exact same problem trying to setup a new CafeX project. I followed the documentation exactly and was faced with 87 linker errors when I tried to build. I fixed this by adding libstdc++.6.dylib which I noticed was in there sample app but not mentioned in the docs.