Xcode error: ld: library not found for -lgomp - objective-c

I'm compiling a project in Objective-C depending on libraries in C.
The compilation fails with the following error:
Ld /Users/user/Library/Developer/Xcode/DerivedData/MyProject-enqkiqdfplxedfeowxlkwfgadtyz/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp normal i386
cd /Users/user/Documents/XCodeWorkspace/MyProject/Subproject
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/user/Library/Developer/Xcode/DerivedData/MyProject-enqkiqdfplxedfeowxlkwfgadtyz/Build/Products/Debug-iphonesimulator -L/Users/user/Documents/XCodeWorkspace/MyProject/Subproject/../../../../../Library/Developer/Xcode/DerivedData/MyProject-enqkiqdfplxedfeowxlkwfgadtyz/Build/Products/Debug-iphoneos -F/Users/user/Library/Developer/Xcode/DerivedData/MyProject-enqkiqdfplxedfeowxlkwfgadtyz/Build/Products/Debug-iphonesimulator -filelist /Users/user/Library/Developer/Xcode/DerivedData/MyProject-enqkiqdfplxedfeowxlkwfgadtyz/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/MyApp.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fopenmp -licucore -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 -lamsip -lcares -lexosip2 -lgsm -lmediastreamer2 -lspeex -lsrtp -lsqlite3.0 -framework MessageUI -framework AudioToolbox -framework AVFoundation -lz -framework AddressBook -framework AddressBookUI -framework Foundation -framework UIKit -framework CoreGraphics -framework SystemConfiguration -framework CoreTelephony -lTestFlight -o /Users/user/Library/Developer/Xcode/DerivedData/MyProject-enqkiqdfplxedfeowxlkwfgadtyz/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp
ld: library not found for -lgomp
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
The problem I see is that this library isn't even specified in the link command! Why is this needed at all?
Yours,
Emmanuel

Someone had enabled OpenMP using "other flags" which causes the -lgomp library to be included. :-(

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.

After copying some files over to my project i received these errors, any idea how i would go about fixing this?

Ld /Users/alexcov329/Library/Developer/Xcode/DerivedData/HF_Navigator-azauuargjyhgsufbmentrezohhkr/Build/Products/Debug-iphonesimulator/HF\ Navigator.app/HF\ Navigator normal i386
cd "/Users/alexcov329/Documents/HF Navigator"
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/alexcov329/Library/Developer/Xcode/DerivedData/HF_Navigator-azauuargjyhgsufbmentrezohhkr/Build/Products/Debug-iphonesimulator -F/Users/alexcov329/Library/Developer/Xcode/DerivedData/HF_Navigator-azauuargjyhgsufbmentrezohhkr/Build/Products/Debug-iphonesimulator -F/Users/alexcov329/Desktop/HF\ Navigator -F/Users/alexcov329/Documents/HF\ Navigator -filelist /Users/alexcov329/Library/Developer/Xcode/DerivedData/HF_Navigator-azauuargjyhgsufbmentrezohhkr/Build/Intermediates/HF\ Navigator.build/Debug-iphonesimulator/HF\ Navigator.build/Objects-normal/i386/HF\ Navigator.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework CoreData -framework SystemConfiguration -framework RevMobAds -framework AdSupport -framework StoreKit -framework UIKit -framework Security -framework QuartzCore -framework MobileCoreServices -framework Parse -lz.1.1.3 -framework CoreLocation -framework CoreGraphics -framework CFNetwork -framework AudioToolbox -framework Foundation -Xlinker -dependency_info -Xlinker /Users/alexcov329/Library/Developer/Xcode/DerivedData/HF_Navigator-azauuargjyhgsufbmentrezohhkr/Build/Intermediates/HF\ Navigator.build/Debug-iphonesimulator/HF\ Navigator.build/Objects-normal/i386/HF\ Navigator_dependency_info.dat -o /Users/alexcov329/Library/Developer/Xcode/DerivedData/HF_Navigator-azauuargjyhgsufbmentrezohhkr/Build/Products/Debug-iphonesimulator/HF\ Navigator.app/HF\ Navigator
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_AppDelegate", referenced from:
objc-class-ref in main.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
You can get this type of error if your class' .m file is not listed under the "Compile Sources" step of the "Build Phases" tab of your target. Normally Xcode does this for you, but sometimes it loses the plot and you need to add the .m file manually.
To do this:
TargetSettings -> Build Phases -> Compile Sources -> add your .m class ->Build and Run
SOURCE FOR ANSWER:
Undefined symbols for architecture i386: _OBJC_CLASS_$_SKPSMTPMessage", referenced from: error

SoundCloud Error (clang failed with exit code 1)

I'm trying to impement SoundCLoudApi from here, but there is clang error without any description:
Ld /Users/dimakorolcenko/Library/Developer/Xcode/DerivedData/scapitest-dbwrumaigeiklgcvrmtokdvcppfu/Build/Products/Debug-iphonesimulator/scapitest.app/scapitest normal i386
cd /Users/dimakorolcenko/Documents/SoundCloudIssues/scapitest
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/dimakorolcenko/Library/Developer/Xcode/DerivedData/scapitest-dbwrumaigeiklgcvrmtokdvcppfu/Build/Products/Debug-iphonesimulator -F/Users/dimakorolcenko/Library/Developer/Xcode/DerivedData/scapitest-dbwrumaigeiklgcvrmtokdvcppfu/Build/Products/Debug-iphonesimulator -filelist /Users/dimakorolcenko/Library/Developer/Xcode/DerivedData/scapitest-dbwrumaigeiklgcvrmtokdvcppfu/Build/Intermediates/scapitest.build/Debug-iphonesimulator/scapitest.build/Objects-normal/i386/scapitest.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -ObjC -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 /Users/dimakorolcenko/Library/Developer/Xcode/DerivedData/scapitest-dbwrumaigeiklgcvrmtokdvcppfu/Build/Products/Debug-iphonesimulator/JSONKit/JSONKit /Users/dimakorolcenko/Library/Developer/Xcode/DerivedData/scapitest-dbwrumaigeiklgcvrmtokdvcppfu/Build/Products/Debug-iphonesimulator/libJSONKit.a /Users/dimakorolcenko/Library/Developer/Xcode/DerivedData/scapitest-dbwrumaigeiklgcvrmtokdvcppfu/Build/Products/Debug-iphonesimulator/libOAuth2Client.a /Users/dimakorolcenko/Library/Developer/Xcode/DerivedData/scapitest-dbwrumaigeiklgcvrmtokdvcppfu/Build/Products/Debug-iphonesimulator/libOHAttributedLabel.a /Users/dimakorolcenko/Library/Developer/Xcode/DerivedData/scapitest-dbwrumaigeiklgcvrmtokdvcppfu/Build/Products/Debug-iphonesimulator/libSoundCloudAPI.a /Users/dimakorolcenko/Library/Developer/Xcode/DerivedData/scapitest-dbwrumaigeiklgcvrmtokdvcppfu/Build/Products/Debug-iphonesimulator/libSoundCloudUI.a /Users/dimakorolcenko/Library/Developer/Xcode/DerivedData/scapitest-dbwrumaigeiklgcvrmtokdvcppfu/Build/Products/Debug-iphonesimulator/OAuth2Client/OAuth2Client /Users/dimakorolcenko/Library/Developer/Xcode/DerivedData/scapitest-dbwrumaigeiklgcvrmtokdvcppfu/Build/Products/Debug-iphonesimulator/SoundCloudAPI/SoundCloudAPI /Users/dimakorolcenko/Library/Developer/Xcode/DerivedData/scapitest-dbwrumaigeiklgcvrmtokdvcppfu/Build/Products/Debug-iphonesimulator/SoundCloudUI/SoundCloudUI -framework CoreText -framework CoreGraphics -framework Security -framework CoreLocation -framework AddressBook -framework AddressBookUI -framework QuartzCore -framework UIKit -framework Foundation -o /Users/dimakorolcenko/Library/Developer/Xcode/DerivedData/scapitest-dbwrumaigeiklgcvrmtokdvcppfu/Build/Products/Debug-iphonesimulator/scapitest.app/scapitest
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
I have completed all steps from instruction, but it doesn't work. I have no ideas, how to solve it. Please, help me to find solution. May be it is more common error, and it is not SoundCloud issue...
Your deployment target is probably wrong.
Select your project in the project navigator on the left side. Go to the build settings tab. Make sure your deployment target is iOS, not OS X.

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.

Libetpan not build on iOS5.1 xcode4.3 in ReMail App

Libetpan is not generating the binaries folder on xcode 5.1. I updated the build-all-deps.sh file
SDKLIST="5.1"
GCC_VERSION="4.2"
PLATFORMDIR="/Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/${platform}.platform"
still not able to generate the binaries.
Error I am getting is:
Ld build/Debug-iphonesimulator/reMail.app/reMail normal i386
cd "/Users/gauri/Spark/user/gauri_shankar#chat.softprodigy.local/downloads/ReMailiPhone/remail-iphone"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Volumes/Xcode/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Volumes/Xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk "-L/Users/gauri/Spark/user/gauri_shankar#chat.softprodigy.local/downloads/ReMailiPhone/remail-iphone/build/Debug-iphonesimulator" "-L/Users/gauri/Spark/user/gauri_shankar#chat.softprodigy.local/downloads/ReMailiPhone/remail-iphone" -L/Users/gauri/Downloads/x2on-OpenSSL-for-iPhone-9754b8d -L/Binaries/iPhoneSimulator-4.3/lib "-L/Users/gauri/Spark/user/gauri_shankar#chat.softprodigy.local/downloads/ReMailiPhone/remail-iphone/../mailcore/libetpan/build-mac/build/Debug" "-F/Users/gauri/Spark/user/gauri_shankar#chat.softprodigy.local/downloads/ReMailiPhone/remail-iphone/build/Debug-iphonesimulator" -filelist "/Users/gauri/Spark/user/gauri_shankar#chat.softprodigy.local/downloads/ReMailiPhone/remail-iphone/build/ReMailIPhone.build/Debug-iphonesimulator/ReMail.build/Objects-normal/i386/reMail.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -all_load -ObjC -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -letpan-iphone -letpan /Users/gauri/three20/Build/Products/Debug-iphonesimulator/libThree20.a /Users/gauri/three20/Build/Products/Debug-iphonesimulator/libThree20Core.a /Users/gauri/three20/Build/Products/Debug-iphonesimulator/libThree20Network.a /Users/gauri/three20/Build/Products/Debug-iphonesimulator/libThree20Style.a /Users/gauri/three20/Build/Products/Debug-iphonesimulator/libThree20UI.a /Users/gauri/three20/Build/Products/Debug-iphonesimulator/libThree20UICommon.a /Users/gauri/three20/Build/Products/Debug-iphonesimulator/libThree20UINavigator.a "/Users/gauri/Spark/user/gauri_shankar#chat.softprodigy.local/downloads/build/Debug-iphonesimulator/MailCore/MailCore" -framework libetpan -framework QuartzCore "/Users/gauri/Spark/user/gauri_shankar#chat.softprodigy.local/downloads/build/Debug-iphonesimulator/libmailcore.a" -framework Foundation -framework CoreGraphics -framework SystemConfiguration -framework MessageUI -framework UIKit -liconv.2 -framework CoreLocation -framework AddressBook -framework StoreKit -framework CFNetwork -framework AddressBook -framework AddressBookUI -lsasl2 -lcrypto -lssl -o "/Users/gauri/Spark/user/gauri_shankar#chat.softprodigy.local/downloads/ReMailiPhone/remail-iphone/build/Debug-iphonesimulator/reMail.app/reMail"
Command /Volumes/Xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
Please help me out.