If your iOS project use external static library, sooner or later you will encounter errors like this:
ld: duplicate symbol _SBJSONErrorDomain in ...
This happens when you use library A and library B, each use the same third party library such as SBJson.
One usual way to fix this is rename the conflicting symbol. e.g. rename one of the SBJson to some like LibASBJson. This however require manual work and is error prone.
Today I learn a simpler alternative: Use the preprocessor to rename the symbols automatically during the build phase.
For each of the duplicated symbols, add "-DSBJSONErrorDomain=LibASBJSONErrorDomain" flags to the ‘Other C Flags’ build setting for the library project. You'll found no more duplicate symbol after this setting!
Note: If both library are external and you have no access, you probably need to revert to nasty hacks such as removing classes from static libraries or objcopy.