|
From: | Karlheinz Toni |
Subject: | So now there is a flex quesion :)... |
Date: | Wed, 30 Oct 2002 17:56:58 -0800 |
Hi there again… Finally I understood what
bison and flex are for, at least I think so. int num_lines = 0, num_chars = 0;
%% \n ++num_lines; ++num_chars; . ++num_chars;
%% main() { yylex(); printf( "# of lines = %d, # of chars = %d\n", num_lines, num_chars ); }
so I stored the whole source in a file called test.l In the shell I type: flex test.l which produces a file called: ********************** lex.yy.c ********************** so now, when I try to compile this file via: ********************** gcc lex.yy.c ********************** I get the following error
message: ********************** Undefined
first referenced symbol
in file yywrap
/var/tmp/ccp8SqDe.o ld: fatal: Symbol referencing errors. No output written
to a.out collect2: ld
returned 1 exit status ********************** I also tried gcc lex.yy.c –lfl for I have seen this at some different homepages. To include the lfl library.
Sincerely Karlheinz Toni |
[Prev in Thread] | Current Thread | [Next in Thread] |