Xcode退出代码1 - 重复符号 [英] Xcode Exit Code 1 - Duplicate Symbol

查看:108
本文介绍了Xcode退出代码1 - 重复符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,我知道这已经覆盖了所有地方,只是我无法解决这个问题以挽救我的生命。

Sorry I know this has been covered all over the place, only I can't fix this to save my life.

如果有人能够清楚地解释我的意思已经做了,我可以做些什么来解决这个问题,我将永远感激。

If someone could explain clearly what I might have done and what I might be able to do to fix this I would be forever grateful.

这是我的错误:

Command / Xcode 4 / Platforms / iPhoneOS.platform / Developer / usr / bin / llvm-gcc-4.2失败,退出代码为1

ld: duplicate symbol _OBJC_IVAR_$_sunnyHillsTL._tileMap in /Users/kahanejosh/Library/Developer/Xcode/DerivedData/workingTitle-cawhuhbkmwcesmbqxvkbkbatdbze/Build/Products/Debug-iphoneos/libcocos2d libraries.a(sunnyHillsTL.o) and /Users/kahanejosh/Library/Developer/Xcode/DerivedData/workingTitle-cawhuhbkmwcesmbqxvkbkbatdbze/Build/Intermediates/workingTitle.build/Debug-iphoneos/workingTitle.build/Objects-normal/armv7/sunnyHillsTL.o


Ld /Users/kahanejosh/Library/Developer/Xcode/DerivedData/workingTitle-cawhuhbkmwcesmbqxvkbkbatdbze/Build/Products/Debug-iphoneos/workingTitle.app/workingTitle normal armv7
    cd "/Users/kahanejosh/Documents/iPhone:Mac Dev/Working Title/workingTitle"
    setenv IPHONEOS_DEPLOYMENT_TARGET 3.0
    setenv PATH "/Xcode 4/Platforms/iPhoneOS.platform/Developer/usr/bin:/Xcode 4/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    "/Xcode 4/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2" -arch armv7 -isysroot "/Xcode 4/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk" -L/Users/kahanejosh/Library/Developer/Xcode/DerivedData/workingTitle-cawhuhbkmwcesmbqxvkbkbatdbze/Build/Products/Debug-iphoneos -F/Users/kahanejosh/Library/Developer/Xcode/DerivedData/workingTitle-cawhuhbkmwcesmbqxvkbkbatdbze/Build/Products/Debug-iphoneos -filelist /Users/kahanejosh/Library/Developer/Xcode/DerivedData/workingTitle-cawhuhbkmwcesmbqxvkbkbatdbze/Build/Intermediates/workingTitle.build/Debug-iphoneos/workingTitle.build/Objects-normal/armv7/workingTitle.LinkFileList -dead_strip -all_load -ObjC -miphoneos-version-min=3.0 -framework CoreGraphics -framework Foundation -framework OpenGLES -framework QuartzCore -framework UIKit -framework AudioToolbox -framework OpenAL -lz -framework AVFoundation "-lcocos2d libraries" -o /Users/kahanejosh/Library/Developer/Xcode/DerivedData/workingTitle-cawhuhbkmwcesmbqxvkbkbatdbze/Build/Products/Debug-iphoneos/workingTitle.app/workingTitle

ld: duplicate symbol _OBJC_IVAR_$_sunnyHillsTL._tileMap in /Users/kahanejosh/Library/Developer/Xcode/DerivedData/workingTitle-cawhuhbkmwcesmbqxvkbkbatdbze/Build/Products/Debug-iphoneos/libcocos2d libraries.a(sunnyHillsTL.o) and /Users/kahanejosh/Library/Developer/Xcode/DerivedData/workingTitle-cawhuhbkmwcesmbqxvkbkbatdbze/Build/Intermediates/workingTitle.build/Debug-iphoneos/workingTitle.build/Objects-normal/armv7/sunnyHillsTL.o
collect2: ld returned 1 exit status
Command /Xcode 4/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1


推荐答案

看起来您已经设置了两个目标,并且您的源都在两者中使用。因此,您使用 sunnyHillsTL 类创建一个静态库,该类可以放入 libcocoas2d libraries.a ,然后您也使用相同的目标文件。如果您正在使用该库,或者没有将此类编译为静态库的一部分,则不要直接在目标中使用该类(不要将该类添加到目标)。

It looks like you have two targets set up and your source is getting used in both. So, you create a static library with the sunnyHillsTL class that gets put into libcocoas2d libraries.a and then you are using the same object file as well. Either don't directly use the class in your target (don't add the class to the target) if you're using the library, or don't have this class be compiled as part of the static library.

这篇关于Xcode退出代码1 - 重复符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆