Link error in iOS app - objective-c

I am getting the following error framework not found -fobjc-arc while compiling an iOS app that previously worked fine. I have no idea what framework it cannot find. Does anyone know where I could track this down? thanks.
Ld /Users/baz/Library/Developer/Xcode/DerivedData/ConverserApp-awrbvmghzyuomheukcqjzijxvnai/Build/Products/Debug-iphoneos/ConverserApp.app/ConverserApp normal armv7
cd /Users/baz/Dropbox/Code/_clients/Converser/ConverserApp
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 armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -L/Users/baz/Library/Developer/Xcode/DerivedData/ConverserApp-awrbvmghzyuomheukcqjzijxvnai/Build/Products/Debug-iphoneos -L/Users/baz/Dropbox/Code/_clients/Converser/ConverserApp/../mobile-api-docs.2/converser-canary -L/Users/baz/Dropbox/Code/_clients/Converser/ConverserApp/Libs/Converser -F/Users/baz/Library/Developer/Xcode/DerivedData/ConverserApp-awrbvmghzyuomheukcqjzijxvnai/Build/Products/Debug-iphoneos -F/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries -filelist /Users/baz/Library/Developer/Xcode/DerivedData/ConverserApp-awrbvmghzyuomheukcqjzijxvnai/Build/Intermediates/ConverserApp.build/Debug-iphoneos/ConverserApp.build/Objects-normal/armv7/ConverserApp.LinkFileList -dead_strip -ObjC -framework -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=6.1 -framework SystemConfiguration -framework MessageUI -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -lz -framework Reveal -lVGConversationKit_universal -o /Users/baz/Library/Developer/Xcode/DerivedData/ConverserApp-awrbvmghzyuomheukcqjzijxvnai/Build/Products/Debug-iphoneos/ConverserApp.app/ConverserApp
ld: framework not found -fobjc-arc
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Go to Projects--->Targets---->Build Settings--->Other Linker Flags. Click on the value side and make sure there are no extraneous [ -framework ] values. If so, delete them. Notice the pattern of line [-framework], next line has a framework in quotes, next line has [-framework]. Etc. It should never end with a -framework, nor have extras. These linker flags happen after compile and make sure that the binary is linked with necessary frameworks.

It's not a real framework - your command line contains this bit:
-framework -fobjc-arc
Which is wrong - the -framework flag should be followed by a framework name, not by another flag. You need to find out where that extra -framework is coming from. There are several correct -framework flags in that command too - notice that they all have a framework name included: -framework MessageUI -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics

Related

Undefined symbols for architecture i386 - Updated Scringo

I know this has been asked before and I have been through the many answers but I am still unable to resolve this after hours of trying.
I updated my Scringo and Facebook SDK's and I am now facing this problem:
Ld /Users/Mike/Library/Developer/Xcode/DerivedData/Game_Count-hekdkbexjjzgzzaikucywmaarygl/Build/Products/Game\ Count-iphonesimulator/Game\ Count.app/Game\ Count normal i386
cd "/Users/Mike/Documents/XCode Projects/Game Count"
setenv IPHONEOS_DEPLOYMENT_TARGET 6.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/Mike/Library/Developer/Xcode/DerivedData/Game_Count-hekdkbexjjzgzzaikucywmaarygl/Build/Products/Game\ Count-iphonesimulator -L/Users/Mike/Documents/XCode\ Projects/Game\ Count/Libraries/Flurry -F/Users/Mike/Library/Developer/Xcode/DerivedData/Game_Count-hekdkbexjjzgzzaikucywmaarygl/Build/Products/Game\ Count-iphonesimulator -F/Users/Mike/Documents/XCode\ Projects/Game\ Count/Libraries/RevMob -F/Users/Mike/Documents/XCode\ Projects/Game\ Count/Libraries/Scringo -F/Users/Mike/Documents/FacebookSDK -F/Users/Mike/Documents/XCode\ Projects/Game\ Count/Game\ Count -filelist /Users/Mike/Library/Developer/Xcode/DerivedData/Game_Count-hekdkbexjjzgzzaikucywmaarygl/Build/Intermediates/Game\ Count.build/Game\ Count-iphonesimulator/Game\ Count.build/Objects-normal/i386/Game\ Count.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.0 -lsqlite3 -framework Security -framework Scringo -framework MobileCoreServices -framework AddressBook -framework CoreText -framework Twitter -framework MapKit -framework CoreLocation -lz -framework QuartzCore -framework EventKitUI -framework EventKit -framework FacebookSDK -framework CoreTelephony -framework CoreMedia -framework AVFoundation -framework CFNetwork -framework RevMobAds -framework SystemConfiguration -lFlurry_4.3.0 -framework CoreGraphics -framework StoreKit -framework Accounts -framework MediaPlayer -framework AudioToolbox -framework MessageUI -weak_framework AdSupport -framework iAd -framework Social -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/Mike/Library/Developer/Xcode/DerivedData/Game_Count-hekdkbexjjzgzzaikucywmaarygl/Build/Intermediates/Game\ Count.build/Game\ Count-iphonesimulator/Game\ Count.build/Objects-normal/i386/Game\ Count_dependency_info.dat -o /Users/Mike/Library/Developer/Xcode/DerivedData/Game_Count-hekdkbexjjzgzzaikucywmaarygl/Build/Products/Game\ Count-iphonesimulator/Game\ Count.app/Game\ Count
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_FBWebDialogs", referenced from:
objc-class-ref in Scringo
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have check all my framework dependancies and they are all there. I have no idea to check which .m file is supposed to be included in the "Compile Sources" in Build Settings.
Any insight would be greatly appreciated.
Make sure you're using the latest Facebook SDK (or at least 3.5) when using the latest Scringo versions.
It is probably some mismatch in the library versions.
Select your target from TARGETS and go to Build Phases > Compile Sources > Link Binary With Libraries section.
Check if Scringo Framework is there. If not add it.
If it is, then it looks like your updated Scringo SDK is not compiled for i386 architecture which iOS Simulator has.

unable to execute command: Segmentation fault: 11

I am developing an iPad app. I get following error when try to create Archive of it.
Ld /Users/macbook/Library/Developer/Xcode/DerivedData/LSS-gtlketfveaswhcefyvuepplwjfbu/Build/Intermediates/ArchiveIntermediates/LSS/InstallationBuildProductsLocation/Applications/LSS.app/LSS normal armv7
cd /Users/macbook/Desktop/LSSCodeMarch22
setenv IPHONEOS_DEPLOYMENT_TARGET 4.3
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 armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -L/Users/macbook/Library/Developer/Xcode/DerivedData/LSS-gtlketfveaswhcefyvuepplwjfbu/Build/Intermediates/ArchiveIntermediates/LSS/BuildProductsPath/Debug-iphoneos -L/Users/macbook/Desktop/LSSCodeMarch22/LSS/CrittercismSDK -L/Users/macbook/Desktop/LSSCodeMarch22/LSS/Airship -F/Users/macbook/Library/Developer/Xcode/DerivedData/LSS-gtlketfveaswhcefyvuepplwjfbu/Build/Intermediates/ArchiveIntermediates/LSS/BuildProductsPath/Debug-iphoneos -filelist /Users/macbook/Library/Developer/Xcode/DerivedData/LSS-gtlketfveaswhcefyvuepplwjfbu/Build/Intermediates/ArchiveIntermediates/LSS/IntermediateBuildFilesPath/LSS.build/Debug-iphoneos/LSS.build/Objects-normal/armv7/LSS.LinkFileList -dead_strip -fobjc-link-runtime -miphoneos-version-min=4.3 -lsqlite3 -framework AudioToolbox -framework Security -framework Foundation -framework CoreTelephony -framework StoreKit -lz -framework SystemConfiguration -framework MobileCoreServices -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework MapKit -framework CoreText -framework MessageUI -framework UIKit -lUAirship-1.4.0 -lCrittercism_v3_4_9 -o /Users/macbook/Library/Developer/Xcode/DerivedData/LSS-gtlketfveaswhcefyvuepplwjfbu/Build/Intermediates/ArchiveIntermediates/LSS/InstallationBuildProductsLocation/Applications/LSS.app/LSS
clang: error: unable to execute command: Segmentation fault: 11
clang: error: linker command failed due to signal (use -v to see invocation)
Can anyone please help me in dealing with this problem?
Best Regards
I figured out that one of the third party APIs being used in the app was not compatible with latest iOS (6.1). I removed that framework from the list of frameworks and it worked.

Linker command failed with exit code 1 after moving project from one computer to another

i am new to Xcode and obective-c and I have a problem with a project I have taken over from another developer on another machine. I cannot contact this programmer anymore (fired).
Ld /Users/*****/Library/Developer/Xcode/DerivedData/Dino-eyvcyvuofjuafncdadqeywyvdsra/Build/Products/Debug-iphonesimulator/Dino.app/Dino normal i386
cd /Users/******/Dropbox/Xcode/ABCiTY/Dino
setenv IPHONEOS_DEPLOYMENT_TARGET 5.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 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk -L/Users/******/Library/Developer/Xcode/DerivedData/Dino-eyvcyvuofjuafncdadqeywyvdsra/Build/Products/Debug-iphonesimulator -F/Users/******/Library/Developer/Xcode/DerivedData/Dino-eyvcyvuofjuafncdadqeywyvdsra/Build/Products/Debug-iphonesimulator -filelist /Users/******/Library/Developer/Xcode/DerivedData/Dino-eyvcyvuofjuafncdadqeywyvdsra/Build/Intermediates/Dino.build/Debug-iphonesimulator/Dino.build/Objects-normal/i386/Dino.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=5.1 -lABCityCrossMarketing -framework AdSupport -framework CoreMotion -framework SystemConfiguration -framework CoreData -framework QuartzCore -framework CoreImage -framework AVFoundation -framework StoreKit -framework UIKit -framework Foundation -framework CoreGraphics -lGoogleAnalytics -lGoogleConversionTracking -o /Users/*******/Library/Developer/Xcode/DerivedData/Dino-eyvcyvuofjuafncdadqeywyvdsra/Build/Products/Debug-iphonesimulator/Dino.app/Dino
ld: library not found for -lABCityCrossMarketing
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Can anyone help me with this?
You are missing the library file libABCityCrossMarketing.a.
A google for "ABCityCrossMarketing" returns nothing for me. Looks bad. If you still have access to his machine, then that looks like the only way to recover this file (it's possible this library was written by him and never published).
The message is clear here, I think:
library not found for -lABCityCrossMarketing
This happens when you move folders and the controls or basically any file is misplaced by Xcode and it doesn't know where to find it. You'd have to add it to your project again or change the path to it wherever it was listed.

Linker error after upgrading to Xcode 4.6: armv7, ZBarSDK

So i upgraded to Xcode 4.6 but i'm having problems. I can build and run program with no problem but when i try to create archive i get that error:
Ld /Users/me/Library/Developer/Xcode/DerivedData/ZM-dezzadmbbhmnbdehrgfgxsvipnzu/Build/Intermediates/ArchiveIntermediates/ZM/IntermediateBuildFilesPath/ZM.build/Release-iphoneos/ZM.build/Objects-normal/armv7s/ZM normal armv7s
cd /Users/me/Desktop/zav-mb-iphone-test
setenv IPHONEOS_DEPLOYMENT_TARGET 4.2
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/mitjaresek/Library/Developer/Xcode/DerivedData/ZM-dezzadmbbhmnbdehrgfgxsvipnzu/Build/Intermediates/ArchiveIntermediates/ZM/BuildProductsPath/Release-iphoneos -L/Users/mitjaresek/Desktop/zav-mb-iphone-test/ZBarSDK -F/Users/mitjaresek/Library/Developer/Xcode/DerivedData/ZM-dezzadmbbhmnbdehrgfgxsvipnzu/Build/Intermediates/ArchiveIntermediates/ZM/BuildProductsPath/Release-iphoneos -filelist /Users/mitjaresek/Library/Developer/Xcode/DerivedData/ZM-dezzadmbbhmnbdehrgfgxsvipnzu/Build/Intermediates/ArchiveIntermediates/ZM/IntermediateBuildFilesPath/ZM.build/Release-iphoneos/ZM.build/Objects-normal/armv7s/ZM.LinkFileList -dead_strip -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=4.2 -liconv -framework AVFoundation -framework CoreMedia -framework CoreVideo -framework AddressBook -framework AddressBookUI -framework AudioToolbox -framework QuartzCore -framework SystemConfiguration -framework MessageUI -framework CoreLocation -framework MapKit -framework UIKit -framework Foundation -framework CoreGraphics -lzbar -o /Users/mitjaresek/Library/Developer/Xcode/DerivedData/ZM-dezzadmbbhmnbdehrgfgxsvipnzu/Build/Intermediates/ArchiveIntermediates/ZM/IntermediateBuildFilesPath/ZM.build/Release-iphoneos/ZM.build/Objects-normal/armv7s/ZM
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/me/iphone-test/ZBarSDK/libzbar.a for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
So how do i fix it?
I'm getting really annoyed by that upgrade...
I had a similar issue. For some bizarre reason, removing the entries for ArmV6 & 7, then re-entering them seemed to solve it:

Error "file not found: -fobjc-arc" on compiling IOS App in XCode

after adding the OCMock framework i got that strange error... :(
ld: file not found: -fobjc-arc
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It looks like if the compiler flag tries to be loaded by XCode?
Any idea?
Best regards, hijolan
I was getting the exact same error on Xcode 4.3.2. Here's my navigator log; I'm adding it for Google juice.
Ld /Users/makdad/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator/JournalTests.octest/JournalTests normal i386
cd /Users/makdad/Documents/MT/mt-mobile/iOS/Journal
setenv MACOSX_DEPLOYMENT_TARGET 10.6
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/iPhoneSimulator5.1.sdk -L/Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator -F/Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Intermediates/Journal.build/Debug-iphonesimulator/JournalTests.build/Objects-normal/i386/JournalTests.LinkFileList -mmacosx-version-min=10.6 -bundle_loader /Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator/Journal.app/Journal -Xlinker -objc_abi_version -Xlinker 2 -ObjC -force_load -fobjc-arc -ftest-coverage -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=40100 -lOCMock -framework Twitter -framework MapKit -framework MobileCoreServices -framework SystemConfiguration -lxml2 -licucore -framework CoreData -framework CoreGraphics -framework CFNetwork -framework QuartzCore -framework SenTestingKit -framework UIKit -framework Foundation -o /Users/phooze/Library/Developer/Xcode/DerivedData/Journal-bfkvfbsrkmrsjpddzfmwrstjfkzr/Build/Products/Debug-iphonesimulator/JournalTests.octest/JournalTests
The OCMock instructions explicitly ask you to add linker flags -- -ObjC and -force_load.
-force_load is expecting a value -- see the answer to this question that explains that -all_load is what to use if you don't want to specify a library name.
As someone who just spent 25 minutes on this, I should check again with the OCMock tutorial -- I don't think it was very clear in this instruction.
This blog post has a much better image that shows exactly how your settings should look.