Re: Query About Flex Usage

Dan Haggarty <[email protected]>
Newsgroups gmane.comp.lex.flex.general
Message-ID <[email protected]>
At 11:42 AM 1/7/06, Ramprasad B wrote:
>This is my first post to this mailing list.
>I have one simple query / doubt about generating a lex scanner generator.
>I am doing these steps -
>
># flex parser.l
># gcc lex.yy.c
>
>but after this i get some errors as
>
>/tmp/ccAKLeZj.o(.text+0x1790): In function `yylex':
>: undefined reference to `yywrap'
>/tmp/ccAKLeZj.o(.text+0x1d72): In function `input':
>: undefined reference to `yywrap'
>collect2: ld returned 1 exit status
>
>do wehave to link some library ?

If you don't want to write your own yywrap() function, link in the flex library to use the default implementation:

   gcc lex.yy.c -lfl

Dan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.