iosobjective-cxcodelinker-errorslipo

Cannot use a library in iOS project which is working in another project with same settings


I'm stuck with a ridiculous basic simple issue that is driving me crazy for days now !

Here's the story:

  1. I have a third-party library that stops my project from building when I use it.
  2. I have another sample project that, this library is used in it and is building successfully.
  3. I have checked ALL (literally ALL) the build settings for both "Project Build Settings" and "Target Build Settings" in Xcode and everything looks the same.
  4. Here's the Screenshot for build settings for both projects:

Working Project :Working Build Settings

Not Working Project:Not Working Build Settings

  1. Here's the Screenshot for the Linker errors: Linker Error 1 Linker Error 2 enter image description here
  2. I have searched and seen ALL the lipo:can't open input file error questions and ld: symbol(s) not found for architecture armv7 error questions, but none of the answers seem to work for me. Please do not just reference to Google search results.

  3. I have tried cleaning the project, removing and re-adding files to target, synchronizing linked frameworks on both projects, removing derived data, changing build active architecture only setting, and many other things suggested on other questions.

  4. Since the same library file is being compiled and linked successfully on same device and Xcode and SDK, please do not come up with suggestions like "requesting Vendor for a newer version of library which is compatible with arm64 or etc".

  5. I'm running Xcode 7.1 on OS X El Capitan and I can even provide TeamViewer Access if a closer look on projects is required.

Any helps is reaaaaaally appreciated, I'm really stuck with this.

Thank you in advance.


Solution

  • Xcode only includes standard C++ libraries when linking if it detects a source file that is compiled using C++. This can cause link problems if a library requires some of its symbols to be resolved using libc++ (or similar).

    A workaround is to create an empty .cpp file in the project to fool Xcode. (I prefer that to making a "real" class into .mm because refactoring has never worked for Objective-C++.)