- Home /
Unity3d for iOS, a lot of linker errors after upgrading to Unity 4.5.5
I have an iOS project that makes use of Unity. I say "makes use of Unity" because most part of the project are native Objective-C with UIKit, and a Unity project is integrated into the app. Back then we created this app with Xcode 5.0 and Unity 4.2. Now I'm trying to upgrade the project to XCode 6.1 and Unity 4.5.5. I upgraded the Unity Project successfully and compiled for iOS. Then I copied the 'Classes', 'Data' and 'Libraries' folder from the generated project into our iOS App project, replacing the folders from the previous (Unity 4.2 based) version. After adjusting the code to some of the changes that happened in the Unity provided Objective-C++ files and trying to compile, I get a lot of linker errors, such as:
Undefined symbols for architecture armv7:
"std::_Rb_tree_decrement(std::_Rb_tree_node_base const*)", referenced from:
Pfx::Linker::Detail::HandleImpl::pushAssembly(char const*, unsigned long, unsigned int) in libiPhone-lib.a(linkerdetailhandleimpl.o)
Pfx::Linker::Detail::HandleImpl::createOutput(unsigned int*, SubstanceLinkerOutputCreate const*) in libiPhone-lib.a(linkerdetailhandleimpl.o)
"std::basic_streambuf<char, std::char_traits<char> >::imbue(std::locale const&)", referenced from:
vtable for std::basic_stringbuf<char, std::char_traits<char>, Alg::UserAllocator<char> > in libiPhone-lib.a(pfxcookerapilinkerhandle.o)
"std::basic_streambuf<char, std::char_traits<char> >::xsgetn(char*, int)", referenced from:
vtable for std::basic_stringbuf<char, std::char_traits<char>, Alg::UserAllocator<char> > in libiPhone-lib.a(pfxcookerapilinkerhandle.o)
"std::basic_streambuf<char, std::char_traits<char> >::xsputn(char const*, int)", referenced from:
vtable for std::basic_stringbuf<char, std::char_traits<char>, Alg::UserAllocator<char> > in libiPhone-lib.a(pfxcookerapilinkerhandle.o)
"std::basic_ostream<char, std::char_traits<char> >::~basic_ostream()", referenced from:
construction vtable for std::ostream-in-std::basic_ostringstream<char, std::char_traits<char>, Alg::UserAllocator<char> > in libiPhone-lib.a(pfxcookerapilinkerhandle.o)
"std::basic_ostream<char, std::char_traits<char> >::~basic_ostream()", referenced from:
construction vtable for std::ostream-in-std::basic_ostringstream<char, std::char_traits<char>, Alg::UserAllocator<char> > in libiPhone-lib.a(pfxcookerapilinkerhandle.o)
"non-virtual thunk to std::basic_ostream<char, std::char_traits<char> >::~basic_ostream()", referenced from:
construction vtable for std::ostream-in-std::basic_ostringstream<char, std::char_traits<char>, Alg::UserAllocator<char> > in libiPhone-lib.a(pfxcookerapilinkerhandle.o)
"vtable for std::basic_ios<char, std::char_traits<char> >", referenced from:
std::basic_ostringstream<char, std::char_traits<char>, Alg::UserAllocator<char> >::basic_ostringstream(std::_Ios_Openmode) in libiPhone-lib.a(pfxcookerapilinkerhandle.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"std::ios_base::ios_base()", referenced from:
std::basic_ostringstream<char, std::char_traits<char>, Alg::UserAllocator<char> >::basic_ostringstream(std::_Ios_Openmode) in libiPhone-lib.a(pfxcookerapilinkerhandle.o)
"typeinfo for std::basic_streambuf<char, std::char_traits<char> >", referenced from:
typeinfo for std::basic_stringbuf<char, std::char_traits<char>, Alg::UserAllocator<char> > in libiPhone-lib.a(pfxcookerapilinkerhandle.o)
"std::basic_streambuf<char, std::char_traits<char> >::sync()", referenced from:
vtable for std::basic_stringbuf<char, std::char_traits<char>, Alg::UserAllocator<char> > in libiPhone-lib.a(pfxcookerapilinkerhandle.o)
"std::locale::locale()", referenced from:
std::basic_ostringstream<char, std::char_traits<char>, Alg::UserAllocator<char> >::basic_ostringstream(std::_Ios_Openmode) in libiPhone-lib.a(pfxcookerapilinkerhandle.o)
"std::locale::~locale()", referenced from:
std::basic_ostringstream<char, std::char_traits<char>, Alg::UserAllocator<char> >::basic_ostringstream(std::_Ios_Openmode) in libiPhone-lib.a(pfxcookerapilinkerhandle.o)
std::basic_ostringstream<char, std::char_traits<char>, Alg::UserAllocator<char> >::~basic_ostringstream() in libiPhone-lib.a(pfxcookerapilinkerhandle.o)
....
In the project settings, "Architectures" is set to "armv7" and "Valid Architectures" is set to "arm64 armv7 armv7s"
What could be going wrong here? Help is highly apreciated!
Answer by temptest123 · Nov 20, 2014 at 06:25 PM
Figured it out. It is necessary to change "C++ Standard Library" in the "Apple LLCM 6.0 -Language - C++" from "Compiler Default" to "libstdc++ (GNU C++ standard library)"
Your answer
Follow this Question
Related Questions
Apple Mach-O Linker Error for arm64 2 Answers
Linker error - Unity on iOS/React Native project 1 Answer
Linker errors on Xcode 4.5.2 with OpenCV 2.4.3 2 Answers
iOS Gamecenter Apple Mach-O Linker errors in xcode build 1 Answer
Linker error when creating a static iOS library that depends on another static library. 1 Answer