Dinesh Raja
Dinesh Raja

Reputation: 8501

Json in iOS5 showing error

"_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)

I got JSON framework files from downloaded example. The examples are working perfectly, but my project showing above errors.

Upvotes: 1

Views: 2116

Answers (3)

pratap reddy
pratap reddy

Reputation: 21

go to Projectapp -> Buildphases -> compileSources

here to add all .m files of JSON with + icon. problem will be resolved

Upvotes: 2

Rob Napier
Rob Napier

Reputation: 299275

You didn't add the SBJSON.m file to your target. Check the properties panel for this file, and there should be a checkbox indicating which target it is assigned to. You may have simply forgotten to copy SBJSON.m into your project at all.

Upvotes: 2

user244343
user244343

Reputation:

Symbol(s) not found for architecture i386

The above error occurs in the following situation:

  1. You were trying to run your application in the iPhone/iPad Simulator
  2. The library was only built to run on the physical devices, and does not support being run in the Simulator.

To resolve this, you either need to add i386 to the Valid Architectures of the SBJSON library build target, or test your application using a physical device.

Upvotes: 2

Related Questions