LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (http://www.linuxquestions.org/questions/fedora-35/)
-   -   Lex Programming in Fedora 17 (http://www.linuxquestions.org/questions/fedora-35/lex-programming-in-fedora-17-a-4175453614/)

mahabub hasan 03-11-2013 09:05 AM

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.

theNbomr 03-11-2013 11:54 AM

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.

--- rod.


All times are GMT -5. The time now is 06:35 PM.