yacc under cygwin - undefined symbols

C

Christoph Kukulies

Compilation (make, yacc, lex) of little parser used to work fine under
BSD (FreeBSD) and now that I want to build it under cygwin, I suddenly
get

gcc -c y.tab.c
y.y: In function `yyparse':
y.y:17: error: `lfd' undeclared (first use in this function)
y.y:17: error: (Each undeclared identifier is reported only once

lfd is a static variable which is defined at the end of the .y file,
instead at the beginning. That is, the yyparse main program is appended
at the end instead at the beginning of the generated y.tab.c.

Strange. How can I influence this?
 
M

Mark McIntyre

Compilation (make, yacc, lex) of little parser used to work fine under
BSD (FreeBSD) and now that I want to build it under cygwin, I suddenly
get

lex and yacc are offtopic in CLC,. you probably need to ask in a linux
or unix programming group, or a general programming one.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
K

Keith Thompson

Christoph Kukulies said:
Compilation (make, yacc, lex) of little parser used to work fine under
BSD (FreeBSD) and now that I want to build it under cygwin, I suddenly
get

gcc -c y.tab.c
y.y: In function `yyparse':
y.y:17: error: `lfd' undeclared (first use in this function)
y.y:17: error: (Each undeclared identifier is reported only once

lfd is a static variable which is defined at the end of the .y file,
instead at the beginning. That is, the yyparse main program is appended
at the end instead at the beginning of the generated y.tab.c.

Strange. How can I influence this?

By reading the yacc documentation, Googling, or posting in a more
appropriate newsgroup (perhaps comp.unix.programmer, comp.compilers,
or gnu.utils.help). You don't really have a C question; you have a
yacc question.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top