Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > [OT] Re: problem : yacc v.s c++

Thread Tools

[OT] Re: problem : yacc v.s c++

John Harrison
Posts: n/a

"Lung Sheng" <(E-Mail Removed)> wrote in message
news:bik31j$751$(E-Mail Removed)...
> Hi,All :
> i try to write a parser and use tool "lex" for scanner and "yacc" for
> parser,
> because i use vector of STL to deal information extracted from parser,
> g++ is preferable.
> error message in compilation is
> -----------------------------------------------
> Undefined first referenced
> symbol in file
> yyerror(char const *) /var/tmp/ccMxgftp.o
> ld: fatal: Symbol referencing errors. No output written to a.out
> collect2: ld returned 1 exit status
> -----------------------------------------------
> with compiler gcc 2.95.2
> it seems that linker cannot find the symbol
> but yyerror is used only in
> I don't know what this error message means
> Is any way to fix this problem ?
> Thanks a lot
> Lung Sheng
> ps : The most interesting is when i use another mechine with compiler
> 2.91.66
> the program can pass the compilation

yyerror is defined in the yacc library, but it is usually defined as 'void
yyerror(char*)', notice there is no const.

I've seen this before, some versions of yacc aren't very C++ compatible. I
think the simplest thing would be to define your own version of yyerror, the
other solution is to edit the parser template file that you are using.

BTW this is off topic in comp.lang.c++, which only deals with C++ questions,
not third party libraries. Email me directly if you have any further
problems, I'll be glad to help if I can.


Reply With Quote

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
a yacc problem, help! C Programming 1 10-06-2008 09:25 AM
Lex / Yacc problem Xose Lois Castro C Programming 1 01-10-2008 11:00 PM
RACC and YACC problem in TMail Mikel Lindsaar Ruby 0 10-21-2007 01:42 PM
Parsing - YACC to java exits funnel Java 3 07-31-2003 01:07 PM
Re: [OT, welcome msg] Yacc/G++ parser probs. Mike Wahler C++ 2 07-08-2003 08:39 PM