clang: error: linker command failed with exit code 1 iOS9 - ios

I am getting the following error while running the code.I have recently updated my xcode to xcode 7.
Ld /Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Products/Debug-iphoneos/cdm_reference_player.app/cdm_reference_player normal armv7
cd /Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template
export IPHONEOS_DEPLOYMENT_TARGET=7.0
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 armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -L/Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Products/Debug-iphoneos -L/Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Products/Debug -L/Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios/dev -F/Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Products/Debug-iphoneos -F/Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios/dev -F/Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios_dylib/dev -F/Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios_dylib/release -filelist /Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Intermediates/cdm_player_ios.build/Debug-iphoneos/cdm_reference_player.build/Objects-normal/armv7/cdm_reference_player.LinkFileList -Xlinker -rpath -Xlinker #executable_path/Frameworks -miphoneos-version-min=7.0 -fembed-bitcode-marker -fobjc-arc -fobjc-link-runtime -framework oemcrypto_tfit2-eit_release_dylib /Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Products/Debug-iphoneos/libCocoaAsyncSocket.a /Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Products/Debug-iphoneos/libCocoaHTTPServer.a /Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Products/Debug-iphoneos/libTBXML-iOS.a -framework AVFoundation -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework CoreMedia -framework Foundation -framework Security -framework UIKit -framework oemcrypto_tfit2-eit_dev_dylib -framework oemcrypto_tfit2_dev_dylib_sim -Xlinker -dependency_info -Xlinker /Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Intermediates/cdm_player_ios.build/Debug-iphoneos/cdm_reference_player.build/Objects-normal/armv7/cdm_reference_player_dependency_info.dat -o /Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Products/Debug-iphoneos/cdm_reference_player.app/cdm_reference_player
ld: '/Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios_dylib/release/oemcrypto_tfit2-eit_release_dylib.framework/oemcrypto_tfit2-eit_release_dylib' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
EDIT
see this image.In the error log,it says
oemcrypto_tfit2-eit_release_dylib' does not contain bitcode
do which one do I have to set "NO" and which one to "YES"?
after changing BITCODE setting(if both debug and release are NO,the same error is coming)
ld: warning: ignoring file /Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios_dylib/release/oemcrypto_tfit2-eit_release_dylib.framework/oemcrypto_tfit2-eit_release_dylib, missing required architecture i386 in file /Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios_dylib/release/oemcrypto_tfit2-eit_release_dylib.framework/oemcrypto_tfit2-eit_release_dylib (2 slices)
ld: warning: ignoring file /Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios/dev/oemcrypto_tfit2-eit_dev_dylib.framework/oemcrypto_tfit2-eit_dev_dylib, missing required architecture i386 in file /Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios/dev/oemcrypto_tfit2-eit_dev_dylib.framework/oemcrypto_tfit2-eit_dev_dylib (2 slices)
ld: embedded dylibs/frameworks are only supported on iOS 8.0 and later (#rpath/oemcrypto_tfit2_dev_dylib_sim.framework/oemcrypto_tfit2_dev_dylib_sim) for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

oemcrypto_tfit2-eit_release_dylib.framework/oemcrypto_tfit2-eit_release_dylib
Doesn't contain bitcode, either ask the vendor of this library to provide bit code or disable bitcode for this project
Please read the error message again:
'oemcrypto_tfit2-eit_release_dylib.framework/oemcrypto_tfit2-eit_release_dylib' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7

As far as I can see you have already solved problem with Bitcode, so my answer only about last error messages:
ld: warning: ignoring file /Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios_dylib/release/oemcrypto_tfit2-eit_release_dylib.framework/oemcrypto_tfit2-eit_release_dylib, missing required architecture i386 in file
means that lib doesn't have i386 arch (can't be used on simulator) try build for iOS device
second one:
ld: embedded dylibs/frameworks are only supported on iOS 8.0 and later
but I see that in your project:
export IPHONEOS_DEPLOYMENT_TARGET=7.0
deployment target set to 7.0 so you should decide something with it

Related

Unable to call methods from static library Pax86

I wanted to use the Pax86 library for iOS. Intially I tried creating the library manually, as I had all the required files. But it consists of file with code to create a static library which can be run on the terminal but only for iPhonesdk4.3. Since I have the iPhonesdk7.1 I was not able to create the Pax86 library. I do not have a system with iPhonesdk4.3. A static library build on iPhoneSDK4.3 was later provided.
I added the static library (.a) file to a new project also included the "include" file of pax86 to the new app.
When i try calling any method related to pax86, error occurs as mentioned below:
For Simulator:
Ld /Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Products/Debug-iphonesimulator/abc.app/abc normal i386
cd /Users/xyz/Documents/Sample_programs/abc
export IPHONEOS_DEPLOYMENT_TARGET=7.1
export PATH="/Users/xyz/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Users/ramani/Documents/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Users/xyz/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Users/xyz/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk -L/Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Products/Debug-iphonesimulator -L/Users/xyz/Documents/Sample_programs/abc/abc -L/Users/xyz/Documents/Sample_programs/abc/abc -F/Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Products/Debug-iphonesimulator -filelist /Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Intermediates/abc.build/Debug-iphonesimulator/abc.build/Objects-normal/i386/Shell.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.1 -framework CoreLocation -framework CoreGraphics -lpax86 -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Intermediates/abc.build/Debug-iphonesimulator/Shell.build/Objects-normal/i386/abc_dependency_info.dat -o /Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Products/Debug-iphonesimulator/abc.app/abc
ld: warning: ignoring file /Users/xyz/Documents/Sample_programs/abc/abc/libpax86.a, file was built for archive which is not the architecture being linked (i386): /Users/xyz/Documents/Sample_programs/abc/abc/libpax86.a
Undefined symbols for architecture i386:
"_retro_api_version", referenced from:
-[ViewController viewDidLoad] in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
For Device:
Ld /Users/xyz/Library/Developer/Xcode/DerivedData/Shell-dvbzzlhzahggryayfurclxrbdjio/Build/Products/Debug-iphoneos/abc.app/Shell normal armv7
cd /Users/ramani/Documents/Sample_programs/Shell
export IPHONEOS_DEPLOYMENT_TARGET=7.1
export PATH="/Users/xyz/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Users/ramani/Documents/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Users/xyz/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Users/xyz/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -L/Users/ramani/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Products/Debug-iphoneos -L/Users/xyz/Documents/Sample_programs/abc/abc -L/Users/xyz/Documents/Sample_programs/abc/abc -F/Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Products/Debug-iphoneos -filelist /Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Intermediates/abc.build/Debug-iphoneos/Shell.build/Objects-normal/armv7/Shell.LinkFileList -dead_strip -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.1 -framework CoreLocation -framework CoreGraphics -lpax86 -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Intermediates/abc.build/Debug-iphoneos/Shell.build/Objects-normal/armv7/abc_dependency_info.dat -o /Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Products/Debug-iphoneos/abc.app/abc
ld: archive has no table of contents file '/Users/xyz/Documents/Sample_programs/abc/abc/libpax86.a' for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have set "Build Active Architecture" to both "YES" and "NO" removed all other architecture like armv7s, arm64 etc but still the above mentioned issues occur.
I have even added the .a file to usr/lib and then added it in Build Settings. cleared the Library Search Path and Framework Search Path.
I imported the static libary as present in the screenshot attached, and tried even without the "include".
Could you please help me resolve this issue. Is it because the static library is only meant for iPhoneSDK4.3 and not iPhoneSDK7.1 or any other SDK. I have tried it in iPhoneSDK3.2 as well, but no luck.
Please help.
Thanks in advance.
The static library was built for iPhone SDK 4.3, and will only work with that. It probably contains symbols for architecture armv6 only, while you are trying to use in i386 (simulator) and armv7/armv7s/arm64 (devices).
Your solution is to build that library using newer SDKs.

How to solve Mach-O-Linker error in ios7 & Xcode 5.0.1

I cannot compile my project for the simulator .
I get Apple Mach-O-Linker error.I cant understand how to solve the issues.I am using xcode 5.0.1.
Please help me any body.
Thanks in advance.
Ld /Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Products/Debug-iphonesimulator/ClassifiedDetails.app/ClassifiedDetails normal i386
cd /Users/murthych/Desktop/ClassifiedDetails
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
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/iPhoneSimulator7.0.sdk -L/Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Products/Debug-iphonesimulator -F/Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Intermediates/ClassifiedDetails.build/Debug-iphonesimulator/ClassifiedDetails.build/Objects-normal/i386/ClassifiedDetails.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework XCTest -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Intermediates/ClassifiedDetails.build/Debug-iphonesimulator/ClassifiedDetails.build/Objects-normal/i386/ClassifiedDetails_dependency_info.dat -o /Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Products/Debug-iphonesimulator/ClassifiedDetails.app/ClassifiedDetails
Mach-O-Linker error message
building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/XCTest.framework/‌​XCTest' for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) "
XCTest.framework needs to be linked only to the unit test target in your project. It should not be added to the UI application target.
What I have found is when adding XCTest.framework Xcode adds extra \ to Framework Search Paths
\"$(SDKROOT)/Developer/Library/Frameworks\"
\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"
$(DEVELOPER_FRAMEWORKS_DIR)
This causes linker issue,
ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/XCTest.framework/XCTest' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
To resolve this issue in XCode 5.1 goto the main ProjectWindow, Tab Build Settings -> Section Search Path -> Framework Search Paths and edit to remove \ appearing the paths.
Hope that helps!
Deleting the test target and creating a new one and then copying the tests over can fix this.
I suggest you to use xcode 5.02 stable version and then hopefully these Mac-O Linker errors will be resolved.same problems I am facing too before installing xcode 5.02.

An error encounter on iPhone 4S test Device (real device) i.e "apple mach -o linker error linker command failed with exit code 1"

I am using tesseract api in my iPhone app for IOS SDK 7.0 in Xcode 5, which run perfectly on simulator but on test devise (real device) it is showing an error i.e "apple mach -o linker error linker command failed with exit code 1", please any body help me to solve the problem. Problem is:-
Ld /Users/newtechfusion/Library/Developer/Xcode/DerivedData/CardScan-cycclrddpdetmngbjcyzotcszjfe/Build/Products/Debug-iphoneos/CardScan.app/CardScan normal armv7
cd "/Users/newtechfusion/Downloads/CardScan-master 5"
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
setenv PATH "/Applications/Xcode 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode 2.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode\ 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode\ 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -L/Users/newtechfusion/Library/Developer/Xcode/DerivedData/CardScan-cycclrddpdetmngbjcyzotcszjfe/Build/Products/Debug-iphoneos -L/Users/newtechfusion/Downloads/CardScan-master\ 5/tesseract-ocr/outdir -F/Users/newtechfusion/Library/Developer/Xcode/DerivedData/CardScan-cycclrddpdetmngbjcyzotcszjfe/Build/Products/Debug-iphoneos -filelist /Users/newtechfusion/Library/Developer/Xcode/DerivedData/CardScan-cycclrddpdetmngbjcyzotcszjfe/Build/Intermediates/CardScan.build/Debug-iphoneos/CardScan.build/Objects-normal/armv7/CardScan.LinkFileList -fobjc-link-runtime -stdlib=libstdc++ -miphoneos-version-min=7.0 -framework QuartzCore -framework CFNetwork -framework SystemConfiguration -framework Security -framework CoreData -framework Foundation -framework UIKit -framework CoreGraphics -licucore.A -ltesseract_api -ltesseract_ccstruct -ltesseract_ccutil -ltesseract_classify -ltesseract_cutil -ltesseract_dict -ltesseract_image -ltesseract_main -ltesseract_textord -ltesseract_training -ltesseract_viewer -ltesseract_wordrec -framework AddressBook -framework AddressBookUI -lsqlite3.0 -Xlinker -dependency_info -Xlinker /Users/newtechfusion/Library/Developer/Xcode/DerivedData/CardScan-cycclrddpdetmngbjcyzotcszjfe/Build/Intermediates/CardScan.build/Debug-iphoneos/CardScan.build/Objects-normal/armv7/CardScan_dependency_info.dat -o /Users/newtechfusion/Library/Developer/Xcode/DerivedData/CardScan-cycclrddpdetmngbjcyzotcszjfe/Build/Products/Debug-iphoneos/CardScan.app/CardScan
"ld: file is universal (2 slices) but does not contain a(n) armv7 slice: /Users/newtechfusion/Downloads/CardScan-master 5/tesseract-ocr/outdir/libtesseract_api.a file '/Users/newtechfusion/Downloads/CardScan-master 5/tesseract-ocr/outdir/libtesseract_api.a' for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)"
!Linker command failed with exit code 1 (use -v to see invocation)
This means your library "libtesseract_api.a" is not compiled for armv7. You need library same library compiled with armv7. If you still want to use this library you will have to remove support for armv7 (better you compile library with armv7 as armv7, armv7s are used in most of iOS devices) go to Project -> Build Settings -> remove the architecture armv7 from "valid architectures". And set "Build Active Architecture Only" to Yes as you want to build app for configured architecture

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

Resources