编译iPhone时出现Obj-class-ref错误

时间:2012-04-10 05:49:02

标签: iphone ios5

Ld /Users/rajeshmedampudi/Library/Developer/Xcode/DerivedData/sampleResource-flngddqnaawregcrrshzpianssjc/Build/Products/Debug-iphonesimulator/sampleResource.app/sampleResource normal i386
    cd /Users/rajeshmedampudi/Dropbox/Work/iphone/sampleResource
    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/rajeshmedampudi/Library/Developer/Xcode/DerivedData/sampleResource-flngddqnaawregcrrshzpianssjc/Build/Products/Debug-iphonesimulator -F/Users/rajeshmedampudi/Library/Developer/Xcode/DerivedData/sampleResource-flngddqnaawregcrrshzpianssjc/Build/Products/Debug-iphonesimulator -filelist /Users/rajeshmedampudi/Library/Developer/Xcode/DerivedData/sampleResource-flngddqnaawregcrrshzpianssjc/Build/Intermediates/sampleResource.build/Debug-iphonesimulator/sampleResource.build/Objects-normal/i386/sampleResource.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/rajeshmedampudi/Library/Developer/Xcode/DerivedData/sampleResource-flngddqnaawregcrrshzpianssjc/Build/Products/Debug-iphonesimulator/sampleResource.app/sampleResource

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_User", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_AuthenticationViewController", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_AppHelpers", 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)

这是我在尝试运行文件时遇到的错误...我已经将这些类从另一个项目导入到这个非基于弧的类并转换为ARC。在成功删除所有对autorelease的引用并从中保留后,我收到此错误。

1 个答案:

答案 0 :(得分:2)

您是否尝试过Product-> Clean? 或者重启XCode? 您确定已将所有内容都包含在目标 - >构建阶段 - >编译源中吗? Xcode为你做这件事,但有时它会错过。