Today, when the Friends of the League to share, the error caused the system crashes. Weibo SDK compile time error, need in buildsetting in other linker, add-OBJC, note O and C uppercase.
Some third-party libraries have a category for the system library classes,
At this point, you need to use the compile parameters:-OBJC, so that the third-party library of the System class extension method can be used in the project.
However, after using-OBJC, there are two problems:
1, undefined symbols
2. Duplicate symbol
Undefined symbols describes a library in the project that does not introduce a third-party library reference.
If you do not add the-OBJC parameter, you will not get an error at compile time, but the runtime uses a method that does not reference the library, and the system crashes.
The problem is well solved. As long as the missing library is found, the introduction of the project is possible.
The problem with duplicate symbol is not solved, which means that the class name in the third-party library and the class name in the project, or the names of the classes in the other third-party libraries.
The most common example of this class, such as reachability, if the third-party library references, their own project also quoted, will be reported duplicate symbol.
If the referenced third-party library has no source code, you can only rename the name class in your project.
To deal with the above problem, if you want to make a library, pay attention to two points:
1, avoid the system class plus category, so that others use your library, do not add OBJC parameters can also use your library.
2, if the library used in other third-party source code, especially with the more common, such as reachability, must be
These classes are renamed, and the most common practice is to prefix the class names. To avoid the problem of duplicate symbol when others use your library.
Description of the compilation parameter-OBJC