Json in iOS5 showing error - ios

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

Symbol(s) not found for architecture i386
The above error occurs in the following situation:
You were trying to run your application in the iPhone/iPad Simulator
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.

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.

go to Projectapp -> Buildphases -> compileSources
here to add all .m files of JSON with + icon. problem will be resolved

Related

Undefined symbols for architecture arm64 error after accidentally delete target

I accidentally delete target. I created again but i couldn't run my application again. When i set my AppDelegate i get an error.
Ld /Users/cihanozdiker/Library/Developer/Xcode/DerivedData/Moka-foueugicfassxcdbtgwkndrougpu/Build/Intermediates/Moka.build/Debug-iphoneos/Moka.build/Objects-normal/arm64/Moka normal arm64
cd /Users/cihanozdiker/Documents/MokaAfterMerchantFinished
export IPHONEOS_DEPLOYMENT_TARGET=9.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -L/Users/cihanozdiker/Library/Developer/Xcode/DerivedData/Moka-foueugicfassxcdbtgwkndrougpu/Build/Products/Debug-iphoneos -L../include -L../include/barcode -L../include/common -L../include/cyclone_crypto -L../include/EstimoteSDK -L../include/openssl -L../include/EstimoteSDK/Headers -L/Users/cihanozdiker/Documents/MokaAfterMerchantFinished -L../lib -L../lib/AESCrypt-ObjC-master -L../lib/RNCryptor -F/Users/cihanozdiker/Library/Developer/Xcode/DerivedData/Moka-foueugicfassxcdbtgwkndrougpu/Build/Products/Debug-iphoneos -filelist /Users/cihanozdiker/Library/Developer/Xcode/DerivedData/Moka-foueugicfassxcdbtgwkndrougpu/Build/Intermediates/Moka.build/Debug-iphoneos/Moka.build/Objects-normal/arm64/Moka.LinkFileList -Xlinker -rpath -Xlinker #executable_path/Frameworks -miphoneos-version-min=9.1 -ObjC -ObjC -fobjc-arc -fobjc-link-runtime -lcrypto -lssl -lC4NetSdk -Xlinker -dependency_info -Xlinker /Users/cihanozdiker/Library/Developer/Xcode/DerivedData/Moka-foueugicfassxcdbtgwkndrougpu/Build/Intermediates/Moka.build/Debug-iphoneos/Moka.build/Objects-normal/arm64/Moka_dependency_info.dat -o /Users/cihanozdiker/Library/Developer/Xcode/DerivedData/Moka-foueugicfassxcdbtgwkndrougpu/Build/Intermediates/Moka.build/Debug-iphoneos/Moka.build/Objects-normal/arm64/Moka
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_MokaAppDelegate", referenced from:
objc-class-ref in main.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I couldn't fix it. I'm using XCode 7.2.
Make sure that the MokaAppDelegate implementation file (probably MokaAppDelegate.m) is marked as part of your new target.
Select the file in the Project Navigator, look at the File Inspector panel and make sure the right target(s) are selected in the Target Membership pane.

Linker Error with Tests in Xcode

I was following along the instructions for building tests using xcode/appcode from TDD site. I got through the initial part ok and started to experiment in my own project, but I keep getting a linking error and can't figure out where from?
The output I get is this
Ld /Users/prasanth/Library/Developer/Xcode/DerivedData/acidplus-ctbnayjfiyhfxkccqyopjsnfagos/Build/Products/Debug-iphonesimulator/acidplusTests.octest/acidplusTests normal i386
cd /Volumes/Defiant/Freeradical/freeradical_newacidbase/acidplus
setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
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 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk -L/Users/prasanth/Library/Developer/Xcode/DerivedData/acidplus-ctbnayjfiyhfxkccqyopjsnfagos/Build/Products/Debug-iphonesimulator -LLibs/OCMock/iOS -LLibs/OCMock/iOS/OCMock -F/Users/prasanth/Library/Developer/Xcode/DerivedData/acidplus-ctbnayjfiyhfxkccqyopjsnfagos/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/prasanth/Library/Developer/Xcode/DerivedData/acidplus-ctbnayjfiyhfxkccqyopjsnfagos/Build/Intermediates/acidplus.build/Debug-iphonesimulator/acidplusTests.build/Objects-normal/i386/acidplusTests.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -force_load Libs/OCMock/iOS/libOCMock.a -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.1 -framework CoreGraphics -framework SenTestingKit -framework UIKit -framework Foundation -lOCMock -o /Users/prasanth/Library/Developer/Xcode/DerivedData/acidplus-ctbnayjfiyhfxkccqyopjsnfagos/Build/Products/Debug-iphonesimulator/acidplusTests.octest/acidplusTests
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_BPG_testModelObject", referenced from:
objc-class-ref in testModelTest.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I tried looking at missing Sources or Linked libraries, but couldn't find anything. Anyone know what else could be wrong?
thanks!
Have you tried the following:
Go to XCode, Under Project -> do a clean and Build your solution again.

Apple Mach-O Linker Error

I have tried to add a testunit target to my project but failed enourmously.
My testunit requires libxml2.dylib (actually libxml2.2.dylib) and of course sentestingunit.framework.
I add the libxml2.dylib to the FRAMEWORK_SEARCH_PATHS in build settings
$(inherited) "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Library/Frameworks"
Then I add the sentestingunit.framework in the build phase -> link binary with libraries.
I have my app (called vindfyrar) as a target dependencies.
Now the the build of my testing target start to scream all the stuff below;
Any one got an idea what I have done wrong?
i386? Why?
Beleive me on this one, I have done my homework, i e googled and try every option in the build settings that could possible be wrong... No success.
XCode 4.6 on Lion 10.7.5
Kind regards,
Jan Gifvars
Ld /Users/jan/Library/Developer/Xcode/DerivedData/vivasjofart-dvimgeakkxnlwqceslyrhdyifmtf/Build/Products/Debug-iphonesimulator/DavisTest.octest/DavisTest normal i386
cd /Users/jan/utveckling/vivasjofart/vivasjofart
setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
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 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk -L/Users/jan/Library/Developer/Xcode/DerivedData/vivasjofart-dvimgeakkxnlwqceslyrhdyifmtf/Build/Products/Debug-iphonesimulator -L/Users/jan/utveckling/vivasjofart/vivasjofart -L/Users/jan/utveckling/vivasjofart/vivasjofart/../../coreplot-examples/DatePlot -L/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib -L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib -F/Users/jan/Library/Developer/Xcode/DerivedData/vivasjofart-dvimgeakkxnlwqceslyrhdyifmtf/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/jan/Library/Developer/Xcode/DerivedData/vivasjofart-dvimgeakkxnlwqceslyrhdyifmtf/Build/Intermediates/vivasjofart.build/Debug-iphonesimulator/DavisTest.build/Objects-normal/i386/DavisTest.LinkFileList -bundle_loader /Users/jan/Library/Developer/Xcode/DerivedData/vivasjofart-dvimgeakkxnlwqceslyrhdyifmtf/Build/Products/Debug-iphonesimulator/vindfyrar.app/vindfyrar -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.1 -framework SenTestingKit -framework UIKit -framework Foundation -o /Users/jan/Library/Developer/Xcode/DerivedData/vivasjofart-dvimgeakkxnlwqceslyrhdyifmtf/Build/Products/Debug-iphonesimulator/DavisTest.octest/DavisTest
ld: warning: ignoring file /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/bundle1.o, missing required architecture i386 in file /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/bundle1.o (2 slices)
ld: warning: ignoring file /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib/libobjc.dylib, missing required architecture i386 in file /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib/libobjc.dylib (2 slices)
ld: warning: ignoring file /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib/libSystem.dylib, missing required architecture i386 in file /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib/libSystem.dylib (2 slices)
ld: in '/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib/libobjc.A.dylib', missing required architecture i386 in file /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib/libobjc.A.dylib (2 slices) for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
You're linking against the iPhoneOS SDKs (where all the binaries are built for architecture arm) but you're building an iPhone Simulator program (i386). Your project is linking against the wrong SDK.
I have solved the problem by adding these setting and values.
For Test Host it's $(BUNDLE_LOADER)
For Bundle Loader it's $(BUILT_PRODUCTS_DIR)/ApplicationName.app/ApplicationProductName
If you want more details log in to apple.developer and search for
"Test case give Apple Mach-O Linker Error"
Thanks everyone for your time!
Kind regards,
Jan Gifvars

Error When Running on iPhone, Works fine on simulator

I get this error when I try to run on a device. When I run it on a simulator it works fine.
This is the error I get:
Ld "/Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Products/Debug-iphoneos/Munch Box.app/Munch Box" normal armv7s
cd "/Users/xxx/Projects/xCode Projects/Munch Box"
setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -L/Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Products/Debug-iphoneos -F/Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Products/Debug-iphoneos -filelist "/Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Intermediates/Munch Box.build/Debug-iphoneos/Munch Box.build/Objects-normal/armv7s/Munch Box.LinkFileList" -dead_strip -fobjc-arc -fobjc-link-runtime -stdlib=libc++ -miphoneos-version-min=6.1 -framework CoreLocation -framework MapKit /Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Products/Debug-iphoneos/libqrencoder.a -framework UIKit -framework Foundation -framework CoreGraphics -o "/Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Products/Debug-iphoneos/Munch Box.app/Munch Box"
ld: warning: ignoring file /Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Products/Debug-iphoneos/libqrencoder.a, file was built for archive which is not the architecture being linked (armv7s): /Users/xxx/Library/Developer/Xcode/DerivedData/Munch_Box-ebibgicdmigfwdbgfdcshfqvxxrc/Build/Products/Debug-iphoneos/libqrencoder.a
Undefined symbols for architecture armv7s:
"_OBJC_CLASS_$_QREncoder", referenced from:
objc-class-ref in TodaysCodeViewController.o
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Turn off the armv7s in the build settings architectures area. See my answer at Failing Archive App RestKit 0.10
Try to delete Derived Data, clean and restart xCode.
You can delete derived data in organizer (cmd+shift+2 or window->organizer) on the projects tab select yours project and press delete on derived data, then clean.
It may helps, but not sure

Coreplot for implementing barchart

Am implementing barchart using coreplot...am getting the errors bellow which am unable to debug. Can anybody please help me out with the solution for this..Tried all ways but still couldn find the solution.
Ld /Users/MacMini/Library/Developer/Xcode/DerivedData/DashBoard-cmeoxsnbrnrzrkcwmgmfxqlfuzvo/Build/Products/Debug-iphonesimulator/DashBoard.app/DashBoard normal i386
cd /Users/MacMini/Desktop/DashBoard
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/iPhoneSimulator4.3.sdk -L/Users/MacMini/Library/Developer/Xcode/DerivedData/DashBoard-cmeoxsnbrnrzrkcwmgmfxqlfuzvo/Build/Products/Debug-iphonesimulator -L/Users/MacMini/Desktop/DashBoard -F/Users/MacMini/Library/Developer/Xcode/DerivedData/DashBoard-cmeoxsnbrnrzrkcwmgmfxqlfuzvo/Build/Products/Debug-iphonesimulator -F/Users/MacMini/Desktop/DashBoard -filelist /Users/MacMini/Library/Developer/Xcode/DerivedData/DashBoard-cmeoxsnbrnrzrkcwmgmfxqlfuzvo/Build/Intermediates/DashBoard.build/Debug-iphonesimulator/DashBoard.build/Objects-normal/i386/DashBoard.LinkFileList -mmacosx-version-min=10.6 -ObjC -all_load -Xlinker -objc_abi_version -Xlinker 2 -framework QuartzCore -lCorePlot-CocoaTouch -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/MacMini/Library/Developer/Xcode/DerivedData/DashBoard-cmeoxsnbrnrzrkcwmgmfxqlfuzvo/Build/Products/Debug-iphonesimulator/DashBoard.app/DashBoard
Undefined symbols for architecture i386:
"_CPTDecimalFromDouble", referenced from:
-[Barchart viewDidLoad] in Barchart.o
"_OBJC_CLASS_$_CPTGraphHostingView", referenced from:
objc-class-ref in Barchart.o
"_OBJC_CLASS_$_CPTXYGraph", referenced from:
objc-class-ref in Barchart.o
"_OBJC_CLASS_$_CPTPlotRange", referenced from:
objc-class-ref in Barchart.o
"_OBJC_CLASS_$_CPTBarPlot", referenced from:
objc-class-ref in Barchart.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This page (in the comments section) may help you with that: http://code.google.com/p/core-plot/wiki/UsingCorePlotInApplications
And this is a previous Stack Overflow question that looks like yours:
Using Core Plot iPhone - Linker error
Here are some fixes I found on the pages above:
In CorePlot-CocoaTouch project settings, change iOS Deployment Target to 3.2
change Build Active Architecture Only to No for all configurations
change C/C++ Compiler Version from GCC 4.2 to LLVM GCC 4.2
Reinstall Core-Plot after downloading its latest stable version

Resources