ld: library not found for -llinphone - xcode

I am facing linker error in Xcode, I compiled Iphone code in Mac Virtual Machine (snow leopard 10.6.6) by following instruction in it Readme file for Mac OS, It compiled successfully,
Now i have to run it in XCode but i am getting fallowing error.
ld: library not found for -llinphone
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
More detail of logs
Ld /Users/mac/Library/Developer/Xcode/DerivedData/linphone-hbezhyqawbboavbueofzjzfsukku /Build/Products/Debug-iphonesimulator/linphone.app/linphone normal i386
cd /Users/mac/Desktop/Iphone/linphone-iphone
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/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk
-L/Users/mac/Library/Developer/Xcode/DerivedData/linphone-hbezhyqawbboavbueofzjzfsukku/Build/Products/Debug-iphonesimulator
-L/Users/mac/Library/Developer/Xcode/DerivedData/linphone-hbezhyqawbboavbueofzjzfsukku/Build/Products/Debug-iphonesimulator
-L/Users/mac/Desktop/Iphone/linphone-iphone/liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins
-L/Users/mac/Desktop/Iphone/linphone-iphone/liblinphone-sdk/apple-darwin/lib
-F/Users/mac/Library/Developer/Xcode/DerivedData/linphone-hbezhyqawbboavbueofzjzfsukku/Build/Products/Debug-iphonesimulator
-filelist /Users/mac/Library/Developer/Xcode/DerivedData/linphone-hbezhyqawbboavbueofzjzfsukku/Build/Intermediates/linphone.build/Debug-iphonesimulator/linphone.build/Objects-normal/i386/linphone.LinkFileList
-mmacosx-version-min=10.6 -l linphone -l mediastreamer -Xlinker -objc_abi_version -Xlinker 2 -lssl -lcrypto
-framework Foundation -weak_framework UIKit
-framework CoreGraphics -framework CoreAudio
-framework AudioToolbox -leXosip2 -losip2
-losipparser2 -lspeex -lspeexdsp
-framework AVFoundation -framework AddressBookUI
-framework AddressBook -framework SystemConfiguration -lilbc -lmsilbc
-framework CFNetwork -lortp -lresolv -lopencore-amrwb -lopencore-amrnb -lmsamr
-o /Users/mac/Library/Developer/Xcode/DerivedData/linphone-hbezhyqawbboavbueofzjzfsukku/Build/Products/Debug-iphonesimulator/linphone.app/linphone
I googled it but could not fix it, please guide me to fix this issue,
Regards

I have also face the same issue and i have solved it by reading README file
download fresh copy of linphone from git.
Before you open your code just follow the instruction of README file.
Now open your project.
Goto BuildSetting and search "Header Search Path". In that you will find that "submodules/linphone/mediastreamer2/include" record is twice.So remove one entry.
Now you can compile your code without any error.

Related

Apple Mach-O Linker (Id) Error for OpenFrameworks

I am using XCode 7.1 on Mac OS X 10.11.1.
I am using an addon called ofXopenNI with openFrameworks, which is basically an OpenNI interface for openFrameworks. It has some requirements which I installed and linked to my XCode project. Still, there's one linking error that I am unable to fix. Here it is (I pasted an image so that I don't miss out on anything):
The problem is that libXnFormats is already included in my project, and yet this issue comes up. This is how I think it's included in the project:
(The second one)
I know there are a lot of Mach-O linking error questions on SO, but this seemed specific. Anyone knows a fix to this?
Here's the error message in text format (since it was asked for):
Ld bin/huReconDebug.app/Contents/MacOS/huReconDebug normal x86_64
cd /Users/ranveer/BTP/openFrameworks/apps/myApps/mac-huRecon
export MACOSX_DEPLOYMENT_TARGET=10.11
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -L/Users/ranveer/BTP/openFrameworks/apps/myApps/mac-huRecon/bin -F/Users/ranveer/BTP/openFrameworks/apps/myApps/mac-huRecon/bin -F/Users/ranveer/BTP/openFrameworks/apps/myApps/mac-huRecon/../../../libs/glut/lib/osx -filelist /Users/ranveer/Library/Developer/Xcode/DerivedData/huRecon-eiqxyontximqaegxzkvzzaxrfiqs/Build/Intermediates/huRecon.build/Debug/huRecon.build/Objects-normal/x86_64/huReconDebug.LinkFileList -mmacosx-version-min=10.11 -dead_strip ../../../libs/poco/lib/osx/PocoCrypto.a ../../../libs/poco/lib/osx/PocoData.a ../../../libs/poco/lib/osx/PocoDataODBC.a ../../../libs/poco/lib/osx/PocoDataSQLite.a ../../../libs/poco/lib/osx/PocoFoundation.a ../../../libs/poco/lib/osx/PocoNet.a ../../../libs/poco/lib/osx/PocoNetSSL.a ../../../libs/poco/lib/osx/PocoUtil.a ../../../libs/poco/lib/osx/PocoXML.a ../../../libs/poco/lib/osx/PocoZip.a ../../../libs/tess2/lib/osx/tess2.a ../../../libs/glew/lib/osx/glew.a ../../../libs/cairo/lib/osx/cairo-script-interpreter.a ../../../libs/cairo/lib/osx/cairo.a ../../../libs/cairo/lib/osx/pixman-1.a ../../../libs/fmodex/lib/osx/libfmodex.dylib ../../../libs/rtAudio/lib/osx/rtAudio.a ../../../libs/openssl/lib/osx/crypto.a ../../../libs/openssl/lib/osx/ssl.a ../../../libs/glfw/lib/osx/libglfw3.a ../../../libs/FreeImage/lib/osx/freeimage.a ../../../libs/freetype/lib/osx/freetype.a ../../../addons/ofxAssimpModelLoader/libs/assimp/lib/osx/assimp.a ../../../addons/ofxKinect/libs/libusb-1.0/lib/osx/usb-1.0.a ../../../addons/ofxOpenCv/libs/opencv/lib/osx/opencv.a -stdlib=libstdc++ -framework Accelerate /Users/ranveer/BTP/openFrameworks/apps/myApps/mac-huRecon/bin/data/lXnFormats.dylib -lXnFormats -framework QTKit -lXnDDK -framework GLUT -lusb-1.0.0 /Users/ranveer/BTP/openFrameworks/apps/myApps/mac-huRecon/bin/data/XnFormats.dylib /Users/ranveer/BTP/openFrameworks/libs/openFrameworksCompiled/lib/osx/openFrameworksDebug.a -framework AGL -lXnVNite_1_5_2 -lnimRecorder -framework ApplicationServices -lXnVCNITE_1_5_2 -framework AudioToolbox -framework CoreAudio -framework CoreFoundation -lnimCodecs -lXnVFeatures_1_5_2 -framework CoreServices -lXnCore -framework OpenGL -lOpenNI -framework QuickTime -lnimMockNodes -lXnDeviceSensorV2KM -framework AppKit -lXnDeviceFile -framework Cocoa -lXnVHandGenerator_1_5_2 -framework IOKit -framework CoreVideo -Xlinker -dependency_info -Xlinker /Users/ranveer/Library/Developer/Xcode/DerivedData/huRecon-eiqxyontximqaegxzkvzzaxrfiqs/Build/Intermediates/huRecon.build/Debug/huRecon.build/Objects-normal/x86_64/huReconDebug_dependency_info.dat -o /Users/ranveer/BTP/openFrameworks/apps/myApps/mac-huRecon/bin/huReconDebug.app/Contents/MacOS/huReconDebug
And then,
ld: library not found for -lXnFormats
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I had a similar issue that I got -lXnDDK linker error instead of -lXnFormats. I assume you created new groups by including include and lib folders under ofxOpenNI addon directory. Also, copied the lib folder into bin/data/openni.
I just add bin/data/openni/lib to the Library Search Paths in Build Settings.
I am using Xcode 7.0.1 on MAC OS X 10.10.5.
Rename the library to XnFormats rather than libXnFormats.
I had a strange issue on Xcode recently, when even when using the -l command (which should prefix lib) did want to work for a custom library.
This might be an Xcode bug. However this should get it working for you now.

Twilio + Apple o mach error

When I try to run the code I get an Apple O-Mach Linker Error. I'm running up to date XCode 4.6, updated yesterday. I'm running 10.8.2 and here is the error code I get.
A few weeks ago I wasn't getting this issue so I don't know if it's updated SDK from Twilio, the XCode update or what. I've also got one of the library's (libTwilioClient.a) thats red in the frameworks section (This is my first iOS and XCode experience). I've tried linking it and then I get 68 errors about other stuff throughout the program not connecting.
Any help? Oh, BTW, I'm just using the HelloMonkey Example from Twilio's SDK, I haven't changed a single thing except the line pointing to my php server for authentication. Also, I've check for any .m in the headers and there are none. I was hoping that it would be smooth sailing since it's coming from Twilio and it's the "Get Started Quick"... so much for that :/
Ld /Users/Animal/Library/Developer/Xcode/DerivedData/HelloMonkey-
acqupeuamziuogblpxusdjhityyf/Build/Products/Debug-iphonesimulator/HelloMonkey.app
/HelloMonkey normal i386
cd "/Users/Animal/Downloads/TwilioClient-1.1.1-dbefc0b/Quick Start/HelloMonkey
"
setenv IPHONEOS_DEPLOYMENT_TARGET 4.2
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/Animal/Library/Developer/Xcode/DerivedData/HelloMonkey-acqupeuamziuo
gblpxusdjhityyf/Build/Products/Debug-iphonesimulator "-L/Users/Animal/Downloads/
TwilioClient-1.1.1-dbefc0b/Quick Start/HelloMonkey/../.." -F/Users/Animal/
Library/Developer/Xcode/DerivedData/HelloMonkey-acqupeuamziuogblpxusdjhityyf/
Build/Products/Debug-iphonesimulator -filelist /Users/Animal/Library/Developer/
Xcode/DerivedData/HelloMonkey-acqupeuamziuogblpxusdjhityyf/Build/Intermediates/
HelloMonkey.build/Debug-iphonesimulator/HelloMonkey.build/Objects-normal/i386/
HelloMonkey.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -all_load
-fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=4.2
-framework AVFoundation -framework Foundation -framework UIKit -framework
CoreGraphics -framework AudioToolbox -framework CFNetwork -framework
SystemConfiguration -lTwilioClient -o /Users/Animal/Library/Developer/Xcode/
DerivedData/HelloMonkey-acqupeuamziuogblpxusdjhityyf/Build/Products/
Debug-iphonesimulator/HelloMonkey.app/HelloMonkey
ld: library not found for -lTwilioClient
clang: error: linker command failed with exit code 1 (use -v to see invocation)
You have to add, other two libraries libcrypto.a and libssl.a along with libTwilioClient.a, then clean and build the project. You are good to go. You can find those libraries in the 'Libraries' folder of the unzipped Twilio bundle. Hope this will help.

Problems with Code from SVN

I have a problem with my iOS code when pulling it from the SVN. My code works fine on my MAC, but after I upload it to SVN and try to build my project it shows the same error over and over.
Apple Mach-O Linker (id) error
ld: library not found for -lzbar
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
This problem is pretty annoying and makes my work on the code very difficult. Here is the complete error:
Ld /Users/administrator/Library/Developer/Xcode/DerivedData/SmartDealer-hezswmtfdvujkibrhkmqudlypdqk/Build/Products/Debug-iphonesimulator/SmartDealer.app/SmartDealer normal i386
cd "/Users/administrator/Desktop/test/Trade-In 4S"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/administrator/Library/Developer/Xcode/DerivedData/SmartDealer-hezswmtfdvujkibrhkmqudlypdqk/Build/Products/Debug-iphonesimulator "-L/Users/administrator/Desktop/test/Trade-In 4S" "-L/Users/administrator/Desktop/test/Trade-In 4S/Classes/ZBarSDK" "-L/Users/administrator/Desktop/test/Trade-In 4S/ZBarSDK" -F/Users/administrator/Library/Developer/Xcode/DerivedData/SmartDealer-hezswmtfdvujkibrhkmqudlypdqk/Build/Products/Debug-iphonesimulator -filelist /Users/administrator/Library/Developer/Xcode/DerivedData/SmartDealer-hezswmtfdvujkibrhkmqudlypdqk/Build/Intermediates/SmartDealer.build/Debug-iphonesimulator/SmartDealer.build/Objects-normal/i386/SmartDealer.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=40000 -framework Foundation -framework UIKit -framework CoreGraphics -framework CoreData -lsqlite3 -framework QuartzCore -weak_framework CoreMedia -weak_framework CoreVideo -liconv -lzbar -weak_framework AVFoundation -o /Users/administrator/Library/Developer/Xcode/DerivedData/SmartDealer-hezswmtfdvujkibrhkmqudlypdqk/Build/Products/Debug-iphonesimulator/SmartDealer.app/SmartDealer
ld: library not found for -lzbar
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
Thanks for your help!
Are you sure that the 'ZBarSDK' folder was successfully included in SVN? It seems that you're trying to link to a framework in that folder, so you should either find a standardized location for the framework and install it on all development machines, or leave your project alone but make sure that the ZBarSDK folder is successfully added to your SVN repo along with your other source.
You can do this from the command line--just cd into your project folder and svn add ZBarSDK.

ld: library not found for -lFlurryWithLocation

I just check out an old project from SVN for my work and when I tried to build it, i got 6 errors.
I can't resolve 2 of 'em.
So the first one is about the Flurry library.
here is the error :
"I replaced the name of the app buy APPNAME"
Ld /Users/MYNAME/Library/Developer/Xcode/DerivedData/APPNAME-ewdtviqnemaxivekjlajlxqanwvm/Build/Products/Debug-iphonesimulator/APPNAME.app/APPNAME normal i386
cd "/Users/MYNAME/Documents/Projects/APPFOLDER/APPNAME"
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 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/MYNAME/Library/Developer/Xcode/DerivedData/APPNAME-ewdtviqnemaxivekjlajlxqanwvm/Build/Products/Debug-iphonesimulator -F/Users/MYNAME/Library/Developer/Xcode/DerivedData/APPNAME-ewdtviqnemaxivekjlajlxqanwvm/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/MYNAME/Library/Developer/Xcode/DerivedData/APPNAME-ewdtviqnemaxivekjlajlxqanwvm/Build/Intermediates/APPNAME.build/Debug-iphonesimulator/APPNAME.build/Objects-normal/i386/APPNAME.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=30100 -framework Foundation -framework UIKit -framework CoreGraphics -lsqlite3.0 -framework AddressBook -framework AddressBookUI -framework CoreLocation -framework SystemConfiguration -framework QuartzCore -framework MessageUI -lFlurryWithLocation -o /Users/MYNAME/Library/Developer/Xcode/DerivedData/APPNAME-ewdtviqnemaxivekjlajlxqanwvm/Build/Products/Debug-iphonesimulator/APPNAME.app/APPNAME
ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/Applications/Xcode.app/Contents/Developer/Library/Frameworks'
ld: library not found for -lFlurryWithLocation
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I tried to find a solution anywhere on the web but I don't...
Then, the next error is :
GenerateDSYMFile /Users/MYNAME/Library/Developer/Xcode/DerivedData/APPNAME-ewdtviqnemaxivekjlajlxqanwvm/Build/Products/Debug-iphonesimulator/APPNAME.app.dSYM /Users/MYNAME/Library/Developer/Xcode/DerivedData/APPNAME-ewdtviqnemaxivekjlajlxqanwvm/Build/Products/Debug-iphonesimulator/APPNAME.app/APPNAME
cd "/Users/MYNAME/Documents/Projects/APPFOLDER/APPNAME"
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/Platforms/iPhoneSimulator.platform/Developer/usr/bin/dsymutil /Users/MYNAME/Library/Developer/Xcode/DerivedData/APPNAME-ewdtviqnemaxivekjlajlxqanwvm/Build/Products/Debug-iphonesimulator/APPNAME.app/APPNAME -o /Users/MYNAME/Library/Developer/Xcode/DerivedData/APPNAME-ewdtviqnemaxivekjlajlxqanwvm/Build/Products/Debug-iphonesimulator/APPNAME.app.dSYM
error: unable to open executable '/Users/MYNAME/Library/Developer/Xcode/DerivedData/APPNAME-ewdtviqnemaxivekjlajlxqanwvm/Build/Products/Debug-iphonesimulator/APPNAME.app/APPNAME'
Can somebody help me please..?
I have no more idea..
Unless the SVN specifically included the libflurryanalytics.a library (which it probably didn't because svn sees .a files as binary files and ignores them).
Download and include the libFlurryAnalytics.a from their website and include it in your target. http://www.flurry.com/product/analytics/index.html
You can then add the file into SVN using:
svn add "libFlurryAnalytics.a" --no-ignore

Sparrow-Framework duplicate symbol error

I am need of some assistance with sparrow framework(http://www.sparrow-framework.org/)/xcode 4/ and my project. I am Getting the following error:
Ld /Users/alex/Library/Developer/Xcode/DerivedData/iDoubtIt-civshevejenwbzfqnllzztidnmzi/Build/Products/Debug-iphonesimulator/iDoubtIt.app/iDoubtIt normal i386
cd /Users/alex/Dropbox/iDoubtIt/iDoubtIt-Sparrow
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/alex/Library/Developer/Xcode/DerivedData/iDoubtIt-civshevejenwbzfqnllzztidnmzi/Build/Products/Debug-iphonesimulator -F/Users/alex/Library/Developer/Xcode/DerivedData/iDoubtIt-civshevejenwbzfqnllzztidnmzi/Build/Products/Debug-iphonesimulator -filelist /Users/alex/Library/Developer/Xcode/DerivedData/iDoubtIt-civshevejenwbzfqnllzztidnmzi/Build/Intermediates/iDoubtIt.build/Debug-iphonesimulator/iDoubtIt.build/Objects-normal/i386/iDoubtIt.LinkFileList -mmacosx-version-min=10.6 -ObjC -all_load -Xlinker -objc_abi_version -Xlinker 2 /Users/alex/Library/Developer/Xcode/DerivedData/iDoubtIt-civshevejenwbzfqnllzztidnmzi/Build/Products/Debug-iphonesimulator/libSparrow.a -framework Foundation -framework UIKit -framework CoreGraphics -framework OpenGLES -framework QuartzCore -framework AVFoundation -framework AudioToolbox -framework OpenAL -o /Users/alex/Library/Developer/Xcode/DerivedData/iDoubtIt-civshevejenwbzfqnllzztidnmzi/Build/Products/Debug-iphonesimulator/iDoubtIt.app/iDoubtIt
ld: duplicate symbol _OBJC_IVAR_$_AIPlayer.hand in /Users/alex/Library/Developer/Xcode/DerivedData/iDoubtIt-civshevejenwbzfqnllzztidnmzi/Build/Intermediates/iDoubtIt.build/Debug-iphonesimulator/iDoubtIt.build/Objects-normal/i386/Game.o and /Users/alex/Library/Developer/Xcode/DerivedData/iDoubtIt-civshevejenwbzfqnllzztidnmzi/Build/Intermediates/iDoubtIt.build/Debug-iphonesimulator/iDoubtIt.build/Objects-normal/i386/ApplicationDelegate.o for architecture i386
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
Thanks in advance.
Probably you have imported an implementation file (*.m file) in your "Game.m" or "ApplicationDelegate.m" file. You should not import implementation files. That causes your implementation file to get compiled two times. That causes duplicate symbol error.
To fix that problem you should fix your import line from foo.m to foo.h.

Resources