Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-27-2003, 07:18 PM   #1
Registered: May 2003
Distribution: RedHat
Posts: 60

Rep: Reputation: 15
Trouble Building Bison Parser


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 respectively. I
then try to build my parser with:

(3) gcc -o test lex.yy.c -ll

but sadly the linker complains thusly:

/tmp/cc8IXvts.o: In function 'yyparse':
/tmp/cc8IXvts.o(.text+0x5a(): undefined reference to

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.

Old 12-09-2003, 06:14 PM   #2
Senior Member
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Do you mean 'undefined reference to yyerror'? You have to generate one by yourself.
See 'info bison' -> Parser C-Language Interface ->Error Reporting.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
checking for XML::Parser... configure: error: XML::Parser perl module is required for kornerr Linux - General 11 11-16-2008 07:24 AM
Bison Parser won't parse a simple program oulevon Programming 5 11-05-2005 11:44 PM
errors building xerces xml parser on SLES 9 (i586) nkshirsagar SUSE / openSUSE 0 05-02-2005 08:12 AM
Trouble building kxdocker 0.20 mauripop Linux - Software 2 04-20-2005 01:59 PM
Trouble building RAZOR froedi Linux - Software 3 02-13-2004 10:34 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:05 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration