我是新的 iPhone 开发者。我收到这个错误。
Ld /Users/c4ntechnology/Library/Developer/Xcode/DerivedData/iPatientCare-azwpvvrjjoaoygfcfqiicwkyssya/Build/Products/Debug-iphonesimulator/iPatientCare.app/iPatientCare normal i386 cd /Users/c4ntechnology/Desktop/iPatientCare 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/c4ntechnology/Library/Developer/Xcode/DerivedData/iPatientCare-azwpvvrjjoaoygfcfqiicwkyssya/Build/Products/Debug-iphonesimulator -F/Users/c4ntechnology/Library/Developer/Xcode/DerivedData/iPatientCare-azwpvvrjjoaoygfcfqiicwkyssya/Build/Products/Debug-iphonesimulator -filelist /Users/c4ntechnology/Library/Developer/Xcode/DerivedData/iPatientCare-azwpvvrjjoaoygfcfqiicwkyssya/Build/Intermediates/iPatientCare.build/Debug-iphonesimulator/iPatientCare.build/Objects-normal/i386/iPatientCare.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 -lsqlite3 -framework UIKit -framework AVFoundation -framework CoreGraphics -o /Users/c4ntechnology/Library/Developer/Xcode/DerivedData/iPatientCare-azwpvvrjjoaoygfcfqiicwkyssya/Build/Products/Debug-iphonesimulator/iPatientCare.app/iPatientCare
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ViewController", referenced from: objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)"_OBJC_CLASS_$_ViewController", referenced from:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
请帮助我
最佳答案
此编译器错误意味着您的 AppDelegate
类正在引用项目中的 ViewController
类,但 ViewController
当前未设置为被编译并包含在最终产品中。
要确保最终产品中包含 ViewController
类,请选择左上列中的蓝色 Xcode 项目图标,如下图所示:
然后在下一列中选择您的目标,然后选择 Build Phases
选项卡,并确保 ViewController.m
与 一起包含在列表中AppDelegate.m
和其他类似的内容。如果当前不存在,要添加它,您可以将最左侧列中的图标拖放到“编译源” TableView 中,或者单击该 TableView 底部的 + 按钮。
关于iphone - 链接器中的 Xcode 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12178411/