【问题标题】:Obj-class-ref error when compiling for an iPhone为 iPhone 编译时出现 Obj-class-ref 错误
【发布时间】:2012-04-22 10:42:24
【问题描述】:
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 的引用并从中保留后,我得到了这个错误。

【问题讨论】:

  • 在其他类中声明了重复变量。引用并清理目标然后运行项目...
  • 我不认为我有任何重复的变量......它们根本没有包含在项目中。

标签: iphone ios5


【解决方案1】:

您尝试过产品->清洁吗? 还是重新启动 XCode? 您是否确保已将所有内容都包含在 Targets->Build Phases->Compile Sources 中? Xcode 会为您执行此操作,但有时它会遗漏一些内容。

【讨论】:

  • 让未来的人们知道,我的哪一项建议有效?
  • 第二个 .. 将文件添加到编译源。我以前没看过……不知何故错过了。
猜你喜欢
  • 1970-01-01
  • 2014-11-23
  • 2012-03-08
  • 1970-01-01
  • 2018-12-27
  • 1970-01-01
  • 2014-01-26
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多