0

everyone.My English is not good....

When I try to run my app in Xcode 7.1 on device , I am getting the following error. Can you pls let me know the issue.

Undefined symbols for architecture arm64:
  "std::string::_Rep::_M_destroy(std::allocator<char> const&)", referenced from:
      elianContext::~elianContext() in liblibelian.a(elian.o)
  "std::string::_Rep::_S_empty_rep_storage", referenced from:
      _elianNew in liblibelian.a(elian.o)
      elianContext::~elianContext() in liblibelian.a(elian.o)
  "std::string::append(char const*, unsigned long)", referenced from:
      _elianNew in liblibelian.a(elian.o)
  "std::string::assign(char const*, unsigned long)", referenced from:
      _elianNew in liblibelian.a(elian.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This is My Xcode Setting--enter image description here. And,I'm --------lipo -create libA.a libB.a libC.a

libA.a support :i386 x86_64 (libA.a is simulator)

libB.a support :armv7 arm64 armv7s

Please help me,thanks!

Luo Hao
  • 11
  • 1
  • 7
  • Possible duplicate of [C++ linking problems, seems like I cant link against standard C++ stuff](http://stackoverflow.com/questions/12849517/c-linking-problems-seems-like-i-cant-link-against-standard-c-stuff) – Danh Dec 26 '15 at 03:29
  • 1
    Thank you your answers!!! T.T I solved the problem! The Way is:Apple LLVM 7.0-language-c++ chose libdc++ (GNU c++ standrd library) – Luo Hao Dec 26 '15 at 03:52

2 Answers2

0

Go to "Build Settings" --> "Valid Architectures" and make sure you have arm64, armv7 and armv7s added. If you add any of these, go to "product" --> "clean" then try running the app on your device again. Good luck, hope this helps!

LodgeApps
  • 344
  • 1
  • 2
  • 21
0

Forget about complicated answers that can affect other developed apps because you change XCODE inners.

In my experience, this happens because you update versions duplicating projects, that it is the simplest way to do it.

The problem is worked out when you set to YES the "Enable Modules (C and Objetive -C)" parameter in BUILD SETTINGS tab.

I also recommend to compare the BUILD SETTINGS parameters (there are a lot but is faster than rebuild the project ... I do not understand why Apple makes it so complicated) beetween projects than work ok.

BUILD SETTINGS parameters

Dharman
  • 30,962
  • 25
  • 85
  • 135