I got the error when i run react-native run-ios
after upgraded RN to 0.26.0-rc.
Undefined symbols for architecture x86_64:
\"std::terminate()
When I add Facebook SDK to my project, these errors appeared:
Showing Recent Messages
Undefined symbol: ___gxx_personality_v0
Undefined symbol: operator delete(void*)
Undefined symbol: std::__1::__next_prime(unsigned long)
Undefined symbol: vtable for std::length_error
Undefined symbol: ___cxa_rethrow
Undefined symbol: vtable for std::out_of_range
Undefined symbol: std::length_error::~length_error()
Undefined symbol: std::out_of_range::~out_of_range()
Undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*, unsigned long)
Undefined symbol: std::__1::__shared_weak_count::~__shared_weak_count()
Undefined symbol: ___cxa_end_catch
Undefined symbol: ___cxa_allocate_exception
Undefined symbol: std::logic_error::logic_error(char const*)
Undefined symbol: typeinfo for std::exception
Undefined symbol: typeinfo for std::__1::__shared_weak_count
Undefined symbol: operator new(unsigned long)
Undefined symbol: ___cxa_begin_catch
Undefined symbol: vtable for __cxxabiv1::__si_class_type_info
Undefined symbol: std::__1::__vector_base_common<true>::__throw_length_error() const
Undefined symbol: std::__1::__shared_weak_count::__release_weak()
Undefined symbol: typeinfo for std::out_of_range
Undefined symbol: typeinfo for std::length_error
Undefined symbol: ___cxa_throw
Undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
Undefined symbol: std::terminate()
Undefined symbol: std::__1::__basic_string_common<true>::__throw_length_error() const
Undefined symbol: ___cxa_free_exception
This solved my problem:
Build Phases
-->Link Binary With Libraries
--> Add 'libc++.tbd
'.
Resolved with the following advice after running rnpm-plugin-upgrade@0.26:
[...] add
-lc++
inOther Linker Flags
in your xcode project build settings.
As pointed out in comments update target build settings (and not project). You may also need to update the Test target as well.