xcode Apple Mach-O 链接器 (id) 错误 - 困惑?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9136454/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 23:12:28  来源:igfitidea点击:

Apple Mach-O Linker (id) Error - confused?

objective-ciosxcodelinker-errorsmach-o

提问by Solid I

My project had no errors until I did a build. Here's the error log.

在我进行构建之前,我的项目没有错误。这是错误日志。

Ld "/Users/stephanieasan/Library/Developer/Xcode/DerivedData/WC_Class_Codes-fgxjeudpfimhnebtmvmxtzlirxnz/Build/Products/Debug-iphonesimulator/WC Class Codes.app/WC Class Codes" normal i386
cd "/Users/stephanieasan/Desktop/SDK Projects/WC Class Codes"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/stephanieasan/Library/Developer/Xcode/DerivedData/WC_Class_Codes-fgxjeudpfimhnebtmvmxtzlirxnz/Build/Products/Debug-iphonesimulator -F/Users/stephanieasan/Library/Developer/Xcode/DerivedData/WC_Class_Codes-fgxjeudpfimhnebtmvmxtzlirxnz/Build/Products/Debug-iphonesimulator -filelist "/Users/stephanieasan/Library/Developer/Xcode/DerivedData/WC_Class_Codes-fgxjeudpfimhnebtmvmxtzlirxnz/Build/Intermediates/WC Class Codes.build/Debug-iphonesimulator/WC Class Codes.build/Objects-normal/i386/WC Class Codes.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=40000 -framework iAd -lsqlite3.0 -framework UIKit -framework Foundation -framework CoreGraphics -o "/Users/stephanieasan/Library/Developer/Xcode/DerivedData/WC_Class_Codes-fgxjeudpfimhnebtmvmxtzlirxnz/Build/Products/Debug-iphonesimulator/WC Class Codes.app/WC Class Codes"

.

.

ld: duplicate symbol _OBJC_IVAR_$_ListTableViewController.DBPath in /Users/stephanieasan/Library/Developer/Xcode/DerivedData/WC_Class_Codes-fgxjeudpfimhnebtmvmxtzlirxnz/Build/Intermediates/WC Class Codes.build/Debug-iphonesimulator/WC Class Codes.build/Objects-normal/i386/Code.o and /Users/stephanieasan/Library/Developer/Xcode/DerivedData/WC_Class_Codes-fgxjeudpfimhnebtmvmxtzlirxnz/Build/Intermediates/WC Class Codes.build/Debug-iphonesimulator/WC Class Codes.build/Objects-normal/i386/ListTableViewController.o for architecture i386
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1

I am very confused, I have been trying to debug this for hours with no success.

我很困惑,我一直在尝试调试这个数小时但没有成功。

回答by rob mayoff

In Code.m, you accidentally said this:

Code.m,你不小心说了这个:

#import "ListTableViewController.m"

You meant to say this:

你想说的是:

#import "ListTableViewController.h"

回答by bravehart_sf

Or the class that you're trying to import has similar class name.

或者您尝试导入的类具有相似的类名。