Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCode Compiler Error: ld: library not found for -loauth

I'm trying to use the Twitter libraries and after adding liboauth.a and adding oauthconsumeriphonelib to my header search path, I'm now down to 1 compilation error, which I can't seem to get rid of.

ld: library not found for -loauth
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

Anyone know what could be causing this?

like image 514
Nefsu Avatar asked Feb 04 '11 08:02

Nefsu


3 Answers

Continuing to What Robin suggested You also need to set the Library Search Path. Right Click the Target File and Choose -- Get Info else you can also get the same by choosing Edit Actice Target Under the Project Tab in XCode. Look for Library Search Path and add this "$(SRCROOT)/Twitter+OAuth/SAOAuthTwitterEngine" Where Twitter+OAuth/SAOAuthTwitterEngine is the directory path for Twitter Library in project folder. I hope this will fix the problem.


enter image description here

like image 58
Rahul Sharma Avatar answered Oct 18 '22 12:10

Rahul Sharma


Well @Nefsu you need to add those libraries to your project by adding an existing framework and then giving the path of the libraries you want to use.

And if you have already added the libraries by drag and drop, than dont remove them just add existing framework by right clicking on groups and folders and add the libraries from the folder and you will be done

like image 25
Robin Avatar answered Oct 18 '22 12:10

Robin


I discovered this HIGHLY misleading message while trying to upgrade to the new Google Analytics library.

In my case the problem was having TWO CONFLICTING COPIES of the library. They were in different folders but both were listed in my App's Library Build Paths (under Build Settings).

Moving all the deprecated library files out of the folder ended up doing the trick and made the mysterious error messages go away.

like image 1
bkbeachlabs Avatar answered Oct 18 '22 11:10

bkbeachlabs