Lex Programming in Fedora 17
I use fedora 17 version. I am trying to write and execute lex
program. But I did not do this .
I have followed these steps :
1. I have written a lex file in vi editor, say 'prog1.l'
2. lex prog1.l
3. cc lex.yy.c -ll
Here, lex.yy.c file has been generated successfully. But errors are
arising at the execution of 3rd instruction. The error is
/usr/bin/ld: can not find -ll
collect2: error : ld returned 1 exit status
I am requesting to you for helping me so that I can do any lex
program. Please give me an example also with proper instructions.
The '-ll' (two lower-case 'ells') is a linker option that says 'link with "libl.so"', where libl.so is the support library required for programs built with (f)lex. The error message is telling you that the linker cannot find that file. You can find it, and add the accordant '-L /path/to/flex/lib' option to the compiler or linker commandline.
For details, man ld.
It is possible that the library is not installed (although that would seem strange, if flex is installed), and you will have to use a package manager to install it. In that case, I would anticipate that it will be installed in a place normally found by ld.
|All times are GMT -5. The time now is 11:19 AM.|