On Apr 13, 2008, at 3:51 PM, Dan Kelley wrote: I'm sorry if this is too simple a question...
I have a project that I'm porting from unix to xcode, and I am not too familiar with using xcode preferences (as opposed to Makefile.am and configure.ac settings). My project needs the "readline" library.
In the old (unix commandline) way of working, I just set -lreadline in a Makefile. How do I accomplish that in xcode?
PS. the library is at e.g. /usr/lib/libreadline.dylib and other spots too, on my system (which has macports also).
I tried clicking the "link with standard libraries" box in the "project [] Info" box but that didn't do anything. (This surprised me, because I thought /usr/lib was a place for standard libraries.)
Again, I apologize if this is too simple a question to ask on this list. Each build takes something like 10 minutes, so it's a bit slow for me to do tests by stumbling in the dark. I was unable to find the required information in the documentation, although I am not sure how to indicate where I was looking, because I was reading the documentation in the xcode reader [hence, no URL to report] and the manuals lack section numbers.
Xcode's documentation is biased towards Mac OS X Frameworks, which are shared libraries bundled with their header files and resources. So while there's little information about using traditional UNIX shared libraries , the same general procedure applies:
1) Choose Project > Add to Project... 2) Type /usr/lib/libreadline.dylib 3) Press Return
That should do it.
The other way of course is to do it the way you'd do it in a makefile:
1) Choose Project > Edit Active Target 2) Click the Build tab 3) Type "Linker" into the search bubble and find the "Other Linker Flags" build setting 4) Enter "-lreadline" into the Value column of Other Linker Flags
Chris |