2011-12-21 59 views
1
"_OBJC_CLASS_$_SBJSON", referenced from: 

Objc-class-ref in JparseViewController.o 

Symbol(s) not found for architecture i386 

Clang: error: linker command failed with exit code 1 (use -v to see invocation) 

Ld /Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Products/Debug-iphonesimulator/Jparse.app/Jparse_armv7 armv7 i386 
    cd "/Users/mag1/Documents/Xcode Projects/Jparse" 
    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/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Products/Debug-iphonesimulator -F/Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Products/Debug-iphonesimulator -filelist /Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Intermediates/Jparse.build/Debug-iphonesimulator/Jparse.build/Objects-armv7/i386/Jparse.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Products/Debug-iphonesimulator/Jparse.app/Jparse_armv7 

Undefined symbols for architecture i386: 
    "_OBJC_CLASS_$_SBJSON", referenced from: 
     objc-class-ref in JparseViewController.o 
ld: symbol(s) not found for architecture i386 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

我从下载的例子中得到了JSON框架文件。这些示例运行良好,但我的项目显示出错误。在以下情况发生时JSON在iOS5中显示错误

+0

这个问题主要是当你的课没有以正确的方式复制时。然后删除旧的和再次复制 – Ron 2011-12-21 04:20:53

回答

2

Symbol(s) not found for architecture i386

上述错误:

  1. 你试图运行在iPhone/iPad的模拟器
  2. 图书馆只是构建了应用程序在物理上运行设备,并且不支持在模拟器中运行。

要解决此问题,您需要将i386添加到SBJSON库生成目标的有效架构,或使用物理设备测试您的应用程序。

+0

如何添加i386到SBJSON库的有效体系结构?我刚刚复制并粘贴JSON框架只有其他例子的文件..是否有任何问题? – 2011-12-21 04:27:57

+1

@darvidsOn非常感谢你....它为我工作一点点。问题是我没有与ARC的JSON更新框架..但现在我清除了我的问题。 – 2011-12-21 11:44:30

2

您没有将SBJSON.m文件添加到您的目标。检查这个文件的属性面板,并且应该有一个复选框指示它分配给哪个目标。您可能完全忘记将SBJSON.m复制到您的项目中。

2

Projectapp - >Buildphases - >compileSources

这里添加JSON的所有.m文件与+图标。问题将得到解决