|Feb 5, 2012, 03:35 PM||#1|
-ll linker flag not working
Hello everyone! I am a casual Xcode user, mostly version 3, but switched to version 4 in December. I am taking a compiler writing course and our initial homework uses lex and yacc.
From a terminal window I can compile the lex output file and execute it using:
gcc lex.yy.c -ll
The gcc being used is from: /Developer/usr/bin and is version
Putting the same file into an Xcode project and trying to compile it returns an Apple Mach-O Linker (ld) Error:
ld: library not found for -ll
Command /Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1
I added the -ll link flag in the "Linking" area of the "Build Settings" under the "Other Linker Flags" option line and see it getting included in the gcc command line. I tried using both LLVM GCC 4.2 and Apple LLVM compiler 3.0 as the selected compiler in the "Build Options->Compiler" field. I also tried using -llibl rather than -ll, but that did not work either.
I really want to be able to use Xcode for the assignments later in the course so I don't have to work directly with gdb. Any suggestions as to how to get Xcode to locate the lex and yacc libraries will be greatly appreciated!!!
|Feb 5, 2012, 03:54 PM||#2|
Instead of trying to add an explicit library flag, try telling XCode to link to the library instead.
Notice that it's not libl.a that actually gets linked in, it's libfl.a. This is because libl.a is a symlink to libfl.a. You've not actually been using lex, but the rewritten and extended flex.
|Feb 7, 2012, 02:35 PM||#3|
Thanks for your help jiminaus! It worked perfectly and this should also help with OpenMP and OpenMPI library issues I had been having as well after switching to Xcode 4.x.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Resolved: YouTube not working on Safari?||deannnnn||OS X||40||Dec 5, 2013 03:25 PM|
|Java Applet not working on Lion||jake4ever||Mac OS X 10.7 Lion||19||Feb 1, 2013 09:44 AM|
|iPhone 4 ringer not working||Causality||iPhone Tips, Help and Troubleshooting||3||Oct 20, 2012 01:07 AM|
|Youtube not working in Safari?||Hyde244||Mac Applications and Mac App Store||12||Nov 16, 2011 11:12 PM|
|Cydia not working day 2!||almac04||Jailbreaks and iOS Hacks||18||Jun 12, 2011 01:22 AM|
All times are GMT -5. The time now is 07:49 PM.