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".