iOS imports a static library of the C + + language after compiling however, first check whether the libstdc++ is imported

Source: Internet
Author: User

Introduction of C + + library in iOS project, compile link times the following error:

"Std::string::_rep::_m_destroy (std::allocator<char> const&)", referenced from:

"Std::_list_node_base::hook (std::_list_node_base*)", referenced from:

"Std::string::p ush_back (char)", referenced from:

"Std::string::append (char const*, unsigned long)", referenced from:

"Std::string::_rep::_s_empty_rep_storage", referenced from:

Obviously, all of these are stdc++ standard library functions.

Check build Phases->link Binary with Libraries also contains the Libstdc++.dylib library

Final Debug Discovery: Libstdc++.dylib is not actually a library, but a shortcut.

Actual use, may appear can not find the library situation, may also find, character problem;

Then, in the solution, replace the libstdc++.dylib directly with the libstdc++.6.0.9.dylib.

Build succeeded~

iOS imports a static library of the C + + language after compiling however, first check whether the libstdc++ is imported

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.