我的项目在编译为 armv7 结构时出现此错误:
duplicate symbol _MD5 in:
/Users/User1/Documents/codes/ProgramList1/libraries/armv7/lib/libcrypto.a(md5_one.o)
/Users/User1/Documents/codes/ProgramList1/ProgramList1/ADs/AdsMoGoLib/AdNetworkLibs/AdMob_SDK_621/libGoogleAdMobAds.a(GADGestureCFiles.o)
ld: 1 duplicate symbol for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我用谷歌搜索了这个问题,我读到有人建议将两个库合并为一个以消除重复的符号,如下所示:
> lipo libGoogleAdMobAds.a -thin armv7 -output libGoogleAdMobAds-armv7.a
> mkdir armv7
> cd armv7/
> ar -x ../libGoogleAdMobAds-armv7.a
> ar -x ../libcrypto.a
> libtool -static -o ../libcrypto-googlead-armv7.a *.o
最后,我回到项目,从链接标志中删除 libGoogleAdMobAds.a 和 libcrypto.a 并将新的组合库添加到项目中。
但我仍然得到同样的错误:
duplicate symbol _MD5 in:
/Users/User1/Documents/codes/ProgramList1/libraries/armv7/lib/libGoogleAdMobAds-armv7.a(md5_one.o)
/Users/User1/Documents/codes/ProgramList1/ProgramList1/ADs/AdsMoGoLib/AdNetworkLibs/libGoogleAdMobAds-armv7.a(GADGestureCFiles.o)
ld: 1 duplicate symbol for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
如您所见,同一个库中有重复的符号。我现在该怎么办?