新的Apple Mach-O链接器(id)错误

时间:2012-09-13 19:43:55

标签: objective-c linker-errors

昨晚,当我完成项目工作时,没有错误。但今天,当我打开我的项目时,我遇到了Apple Mach-O链接(id)错误。这是错误:`Ld /Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Products/Debug-iphonesimulator/WhereAmI.app/WhereAmI normal i386     cd“/ Users / chandlerdeangelis / Desktop / Real Estate App”     setenv MACOSX_DEPLOYMENT_TARGET 10.6     setenv PATH“/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/ usr / sbin目录:/ sbin目录”     /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5。 1.sdk -L / Users / chandlerdeangelis / Library / Developer / Xcode / DerivedData / WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa / Build / Products / Debug-iphonesimulator -F / Users / chandlerdeangelis / Library / Developer / Xcode / DerivedData / WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa / Build / Products / Debug-iphonesimulator -filelist /Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmI.LinkFileList - mmacosx-version-min = 10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED = 50100 -framework MapKit -framework CoreLocation -framework UIKit -framework Foundation-framework CoreGraphics - o /Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Products/Debug-iphonesimulator/WhereAmI.app/WhereAmI

重复符号_OBJC_IVAR _ $ _ WhereAmIAppDelegate._window in:     /Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmIAppDelegate.o     /Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmIViewController.o 重复符号_OBJC_IVAR _ $ _ WhereAmIAppDelegate._viewController in:     /Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmIAppDelegate.o     /Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmIViewController.o 重复符号_OBJC_METACLASS _ $ _ WhereAmIAppDelegate in:     /Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmIAppDelegate.o     /Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmIViewController.o 重复符号_OBJC_CLASS _ $ _ WhereAmIAppDelegate in:     /Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmIAppDelegate.o     /Users/chandlerdeangelis/Library/Developer/Xcode/DerivedData/WhereAmI-bdyziqhatjrwffgkgfvwvtoxdroa/Build/Intermediates/WhereAmI.build/Debug-iphonesimulator/WhereAmI.build/Objects-normal/i386/WhereAmIViewController.o ld:架构i386的4个重复符号 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用) ` 任何人都可以帮助我吗?

1 个答案:

答案 0 :(得分:1)

几个符号(WhereAmIAppDelegate._window,WhereAmIAppDelegate._viewController,...)被定义为重复:在 WhereAmIAppDelegate.o WhereAmIViewController.o

此错误的一个可能原因是您在某处导入了“.m”文件而不是“.h”文件。也许你在 WhereAmIViewController.m 中有一个#import "WhereAmIAppDelegate.m"