2011-12-21 60 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文件與+圖標。問題將得到解決