About Xcode introducing third-party static class libraries duplicate symbol _objc_xxx repeating compilation errors
Look at this http://www.cnblogs.com/cocoajin/p/3917709.html.
Two ways were mentioned before;
One is to modify the Xcode compilation option; one is to remove a party while packaging;
There is a third way today;
Remove the specified duplicate compiled. o file directly in one of the packages using the AR command;
The following scenario demonstrates
Static library libtaobao.a with CEO.M file and CEO method
Static library libbaidu.a compiled with CEO.M files and has CEO method
Then when the above two static libraries appear in the same project, and the other link flag is-all_load, there will be a duplicate compilation error!
From what we can see is ceo.o this file is compiled repeatedly, then from the above two libraries any one of them can be removed
This time to solve the idea:
1. Use Lipo to split. A separately
2. Use the AR command to delete one of the. a conflicts. O
3. Merging with Lipo
The following demo,
Cocoapro:lib-taobao cocoajin$lsLibTaobao.acocoaPro:lib-taobao cocoajin$ Lipo-InfoLIBTAOBAO.A ArchitecturesinchThe Fatfile: libtaobao.a are:armv7 arm64 cocoapro:lib-taobao cocoajin$ Lipo Libtaobao.a-thin ARMV7-Output Tbv7.acocoaPro:lib-taobao cocoajin$ Lipo Libtaobao.a-thin arm64-Output Tb64.acocoaPro:lib-taobao cocoajin$lslibtaobao.a tb64.a tbv7.acocoaPro:lib-taobao cocoajin$ Lipo-Infotb*inputfileTB64.A is not a fatfileinputfileTBV7.A is not a fatfileNon-fatfile: tb64.a is Architecture:arm64non-fatfile: tbv7.a is Architecture:armv7cocoaPro:lib-taobao cocoajin$ar-d tbv7.a CEO.ococoaPro:lib-taobao cocoajin$ar-d tb64.a CEO.ococoaPro:lib-taobao cocoajin$ lipo-create tbv7.a tb64.a-Output LibTaobao.acocoaPro:lib-taobao cocoajin$ Lipo-InfoLIBTAOBAO.A ArchitecturesinchThe Fatfile: libtaobao.a are:armv7 arm64 cocoapro:lib-taobao cocoajin$
View Code
After finally replacing the library that removed CEO.O, the project compiles through and runs normally!
Use the AR command to delete the. o file that the iOS static library repeatedly compiles