今天pod安装了阿里云短视频相关SDK报错:
uplicate symbol '_main' in:
/Users/xxx/Library/Developer/Xcode/DerivedData/xxx-bvtgunydcfbkwhdeqbtsnbtjrumw/Build/Intermediates.noindex/xxx.build/Debug_Official-iphoneos/xxx.build/Objects-normal/arm64/main.o
/Users/xxx/Desktop/SVN/xxx/xxx/Pods/AliyunVideoSDKPro/AliyunVideoSDKPro.framework/AliyunVideoSDKPro(pngtest.o)
ld: 1 duplicate symbol for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
搞了半天才发现是building->other linker flag-> -all_load的问题。
-all_load会导致编译器认为上边两个地方都定义了_main。
故删掉 set building->other linker flag-> -all_load即可。
网友评论