此错误仅在方案设置为 Distribution 而不是 Debug 时产生。有什么想法吗?
ld: duplicate symbol _OBJC_CLASS_$_TouchTrailLayer in /Users/myname/Library/Developer/Xcode/DerivedData/Flashlight-gmurejxadxglkncisufsozykekdz/Build/Products/Distribution-iphoneos/libcocos2d libraries.a(TouchTrailLayer.o) and /Users/myname/Library/Developer/Xcode/DerivedData/Flashlight-gmurejxadxglkncisufsozykekdz/Build/Intermediates/Flashlight.build/Distribution-iphoneos/Flashlight.build/Objects-normal/armv7/TouchTrailLayer.o for architecture armv7
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang++ failed with exit code 1
最佳答案
看起来您在项目中包含了 cocos2d
的源文件,但也链接到了 libcocos2dlibraries
。如果您要链接到 .a
,您应该从您的项目中删除 cocos2d
的源文件。
关于iphone - 链接错误重复符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7761218/