Problems with introducing third-party class libraries in iOS development

Source: Internet
Author: User

In the process of developing an iOS program, it is common to import third-party class library (. a/.o) files to report a series of errors:

Undefined Symbols for Architecture i386:  ' std::string::c_str () const ', referenced from:      mp4chunk::p uttag (std: : string) in libhksumeyesdk.a (MP4CHUNK.O)  "Std::string::empty () const", referenced from:      mp4chunk::p Uttag ( std::string) in libhksumeyesdk.a (MP4CHUNK.O)  "Std::allocator<char>::allocator ()", referenced from:      Mp4chunk::writeftyptag () in libhksumeyesdk.a (MP4CHUNK.O)      Mp4chunk::writefreetag () in LIBHKSUMEYESDK.A ( MP4CHUNK.O)      Mp4chunk::writemdattag () in libhksumeyesdk.a (MP4CHUNK.O)      Mp4chunk::writemoovtag () in LIBHKSUMEYESDK.A (MP4CHUNK.O)      Mp4chunk::writemvhdtag () in libhksumeyesdk.a (MP4CHUNK.O)      Mp4chunk:: Writeiods () in libhksumeyesdk.a (MP4CHUNK.O)      Mp4chunk::writetraktag () in libhksumeyesdk.a (MP4CHUNK.O)

Seemingly missing a class library file, but after several checks found that there is no lack of references, and even with the original demo one is not bad, what is the matter?

Since the third-party class libraries are mostly written in C + + or C, in the reference process, you also need to tell the compiler what kind of language it might appear in order to use the corresponding interpreter for parsing.

OK, then we just need to check the following configuration items in the Xcode environment to see if they match the following:

Targets->build Settings, search

1.Other Linker Flags:-O BJC

2.c++ Language Dialect:compiler Default

3.c++ Standard Library:compiler Default

4.Compile Sources as:objective-c++ or set to the according to file Type, and then change the file suffix referenced to the C + + class library to ". MM".

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.