1

I develop an enterprise iOS platform that uses AllJoyn to communicate between the various tablets. The app has been fairly stable for a few months, but since Apple is discontinuing support for iOS<7 we are moving the platform to iOS7. After updating the project and getting rid of all of the compiler warnings I kept getting the following linker error:

Undefined symbols for architecture armv7:
"std::string::append(char const*, unsigned long)", referenced from:
std::basic_string<char, std::char_traits<char>, 
std::allocator<char> > std::operator+<char, std::char_traits<char>, 
std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&) in libajdaemon.a(json_writer.o)

After searching the AllSeen support site I found this article that seemed relevant. I tried fiddling with the architectures (removing and adding armv7, armv7s and i386), I checked that the location of the AllJoyn SDK was correct, but it definitely wasn't a path or AllJoyn library issue.

I then tried tracking down potential solutions on Stack Overflow and found this thread. Manually adding libstdc++.dylib but adding libstdc++6.0.9.dylib made my project successfully compile. This however created issues with the run time version of the app.

Solution:

I finally came across this thread describing issues related to automatically detecting the appropriate C++ library to link in XCode. After implementing @rimestad's solution I finally got the whole project to work by

Ensur[ing] that C++ Standard Library is set to libstdc++ (GNU c++ standard library) in the Build Settings

Last query:

I still have one more small question that bugs me... why does the iOS6 build (in XCode 5.1) correctly detect that my project needs the GNU C++ standard library while exactly the same IDE set to build for iOS7 (with exactly the same code) fails to detect this?

Community
  • 1
  • 1
carnun
  • 150
  • 11

0 Answers0