Trouble Building Bison Parser
Hello,
I've written a simple lexer/parser pair using flex/bison and I'm having trouble getting it to build. The lex file is named test.l and the parse file is named test.y. I issue the following two commands: (1) flex test.l (2) bison test.y which produce lex.yy.c and test.tab.c respectively. I then try to build my parser with: (3) gcc -o test lex.yy.c test.tab.c -ll but sadly the linker complains thusly: /tmp/cc8IXvts.o: In function 'yyparse': /tmp/cc8IXvts.o(.text+0x5a(): undefined reference to 'yerror' It seems I should be linking against some other library but I can't figure out which one. I've poked around the internet looking for a solution to no avail. I found several reports of people bumping up against this issue but no solutions. If anyone can point me in the right direction I'd be very grateful. Thanks in advance. -exits |
Do you mean 'undefined reference to yyerror'? You have to generate one by yourself.
See 'info bison' -> Parser C-Language Interface ->Error Reporting. |
All times are GMT -5. The time now is 02:05 PM. |