The following error message is displayed:

Showing Recent Messages
Undefined symbol: std::ios_base::Init::Init()

Undefined symbol: std::ios_base::Init::~Init()

Undefined symbol: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)

Undefined symbol: std::string::assign(std::string const&)

Undefined symbol: std::basic_fstream<char, std::char_traits<char> >::basic_fstream()

Undefined symbol: std::basic_fstream<char, std::char_traits<char> >::open(char const*, std::_Ios_Openmode)

Undefined symbol: std::basic_fstream<char, std::char_traits<char> >::close()

Undefined symbol: std::basic_fstream<char, std::char_traits<char> >::~basic_fstream()

Undefined symbol: std::string::_Rep::_S_empty_rep_storage

Undefined symbol: std::string::_Rep::_M_destroy(std::allocator<char> const&)

Undefined symbol: std::ostream::tellp()

Undefined symbol: operator delete[](void*)

Undefined symbol: std::istream::tellg()

Undefined symbol: ___cxa_rethrow

Undefined symbol: std::ostream::write(char const*, long)

Undefined symbol: std::__throw_length_error(char const*)

Undefined symbol: ___cxa_end_catch

Undefined symbol: operator delete(void*)

Undefined symbol: ___cxa_guard_release

Undefined symbol: ___cxa_guard_abort

Undefined symbol: ___cxa_pure_virtual

Undefined symbol: std::istream::read(char*, long)

Undefined symbol: ___gxx_personality_v0

Undefined symbol: operator new[](unsigned long)

Undefined symbol: std::string::compare(std::string const&) const

Undefined symbol: vtable for __cxxabiv1::__si_class_type_info

Undefined symbol: std::istream::seekg(long long, std::_Ios_Seekdir)

Undefined symbol: vtable for __cxxabiv1::__vmi_class_type_info

Undefined symbol: std::__throw_bad_alloc()

Undefined symbol: vtable for __cxxabiv1::__class_type_info

Undefined symbol: operator new(unsigned long)

Undefined symbol: std::basic_filebuf<char, std::char_traits<char> >::is_open() const

Undefined symbol: ___cxa_begin_catch

Undefined symbol: ___cxa_guard_acquire

Undefined symbol: std::terminate()
Copy the code

This is because Xcode10 completely scrapped libstdc++, Dylib, libstdc++.6.0.dylib, libstdc++.dylib, libstdc++.6.0.tbd, libstdc++.6.tbd, libstdc++.tbd are also available from Xcode10 Deleted from.

The best solution is to switch to libc++ development as soon as possible

If you want to continue compiling projects or libraries that depend on libstdc++ on Xcode10, you can do so by copying the libstdc++ related library files from Xcode9 into Xcode10. A search for libstdc++ related libraries in Xcode9 brings up four related files:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes / iOS simruntime/Contents/Resources/RuntimeRoot/usr/lib/libstdc++ 6.0.9. Dylib / Applications/Xcode. App/Contents/Developer/Platforms/MacOSX platform/Developer/SDKs/MacOSX SDK/usr/lib/libstdc++ 6.0.9. T bd / Applications/Xcode. App/Contents/Developer/Platforms/iPhoneOS platform/Developer/SDKs/iPhoneOS SDK/usr/lib/libstdc++. 6.0 .9.tbd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib / libstdc++. 6.0.9. TBDCopy the code
The solution
  • 1. Download the libstdc file
  • 2. Run the script of the xcode version

    Note: If the Xcode path is not in the script, you need to modify it yourself

  • 3. Go to the libstdc–master folder and run sudo sh install.sh
  • Select TARGETS->Build Phases->Link Binary With Libraries and add libstdc++ to the TARGETS->Build Phases->Link Binary With Libraries directory.