Objective-c's advantage is compatible with C + + code, so we can easily in the project to the C + + implementation of the library to use, but the use of the need to set some places, because there is no set up will bring a very strange problem
Here are the errors that the compiler reported when using these libraries, and you can see that the error of the report is very confusing.
At first I thought it was Target's header search path was not set correctly, so it was a long time in build settings.
Later consulted a lot of masters, just know that this is the library code in the reference C + + 's underlying type is not a reference to the cause, we need to reference the corresponding C + + library class set. The main is to set the compilation type of this class,
There are two methods of setting up
- There's an Apple LLVM 5.1-language under Build settings, and we can set up how our code compiles, like
The default is according to file Type, so Xcode will compile to find the settings for each OC file, where the OC file is set in the show in file inspector of the. m file, as
We can choose a different type
The default is Objective-c Sourcce, if we introduce a library using C + + code implementation, we need to set the file to Objective-c++ source, so that Xcode will not be generated at compile time to find __char16_t this error.
- Another option is to set up directly in the Apple LLVM 5.1-language of build settings, which is the compile Sources as setting we saw earlier, where the achievement line is set directly
iOS library references the resulting bug-apple LLVM 5.1-language