duplicate symbol _OBJC_CLASS_$_Base64 in:

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. 這個(gè)過程不僅解決掉了duplicate symbols的問題,也將兩個(gè)類庫合并為一個(gè)。如果你想分別保存兩個(gè)類庫,你可以將duplicate的部分從任意一個(gè)類庫中刪除,你可以相應(yīng)的修改這個(gè)過程。? 總結(jié):按照上述刪掉-all_load后問題得到解決!

http://stackoverflow.com/questions/19742190/duplicate-symbol-objc-class-gtmbase64

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容