duplicate symbol _base64_decode in:
/Users/liangweifeng/Library/Developer/Xcode/DerivedData/Tronker-galdhgtfbjsyrhcljuxdrutjewkv/Build/Intermediates/Tronker.build/Debug-iphoneos/Tronker.build/Objects-normal/arm64/base64.o
/Users/liangweifeng/Desktop/Tronker/tronker-iOS/Tronker/Vendor/LLPay/LLPayUtils/libRsaCrypto.a(base64.o)
duplicate symbol _OBJC_CLASS_$_Base64 in:
/Users/liangweifeng/Library/Developer/Xcode/DerivedData/Tronker-galdhgtfbjsyrhcljuxdrutjewkv/Build/Intermediates/Tronker.build/Debug-iphoneos/Tronker.build/Objects-normal/arm64/base64.o
/Users/liangweifeng/Desktop/Tronker/tronker-iOS/Tronker/Vendor/LLPay/LLPayUtils/libRsaCrypto.a(base64.o)
duplicate symbol _OBJC_METACLASS_$_Base64 in:
/Users/liangweifeng/Library/Developer/Xcode/DerivedData/Tronker-galdhgtfbjsyrhcljuxdrutjewkv/Build/Intermediates/Tronker.build/Debug-iphoneos/Tronker.build/Objects-normal/arm64/base64.o
/Users/liangweifeng/Desktop/Tronker/tronker-iOS/Tronker/Vendor/LLPay/LLPayUtils/libRsaCrypto.a(base64.o)
ld: 3 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
以下是从外国友人那获取的终极解决策略,方案是修改类库: I'm going to assume that these are two third party libraries that have only provided you with the .a files and not the source code. You can use libtool, lipo and ar on the terminal to extract and recombine the files.
To see what architectures are in the file:
$ lipo -info libTapjoy.a
Architectures in the fat file: libTapjoy.a are: armv6 i386
Then to extract just armv6, for example:
$ lipo -extract_family armv6 -output libTapjoy-armv6.a libTapjoy.a
$ mkdir armv6
$ cd armv6
$ ar -x ../libTapjoy-armv6.a
You can then extract the same architecture from the other library into the same directory and then recombine them like so:
$ libtool -static -o ../lib-armv6.a *.o
And then finally, after you've done this with each architecture, you can combine them again with lipo:
$ cd ..
$ lipo -create -output lib.a lib-armv6.a lib-i386.a
This should get rid of any duplicate symbols, but will also combine the two libraries into one. If you want to keep them separate, or just delete the duplicate from one library, you can modify the process accordingly. 这个过程不仅解决掉了duplicate symbols的问题,也将两个类库合并为一个。如果你想分别保存两个类库,你可以将duplicate的部分从任意一个类库中删除,你可以相应的修改这个过程。 总结:按照上述删掉-all_load后问题得到解决!
http://stackoverflow.com/questions/19742190/duplicate-symbol-objc-class-gtmbase64
网友评论