Solved.
Just added an include "stdlib.h" in calc.y.
Also added a -lm in the Makefile to avoid undefined "pow" and "sqrt"
symbol errors.
Sorry for the inconvenience.
David Coste wrote:
Hello everybody,
I'm trying to compile the simple calculator provided in this message :
http://www.mail-archive.com/help-bison@gnu.org/msg00156.html
I get this message :
calc.y: In function ‘calc_parse’:
calc.y:26: warning: incompatible implicit declaration of built-in
function ‘printf’
calc.y:28: error: ‘EXIT_SUCCESS’ undeclared (first use in this function)
calc.y:28: error: (Each undeclared identifier is reported only once
calc.y:28: error: for each function it appears in.)
calc.y:30: warning: incompatible implicit declaration of built-in
function ‘printf’
calc.y: In function ‘calc_error’:
calc.y:68: error: ‘EXIT_FAILURE’ undeclared (first use in this function)
Could someone please help me to solve this problem ?
Should I use specific gcc / flex / bison flags ?
I am using, gcc (Ubuntu 4.3.2-1ubuntu12) 4.3.2,
flex 2.5.35
and bison (GNU Bison) 2.3
Thanks in advance.
David.
This message, including attachments, is intended solely for the addressee
indicated in this message and is strictly confidential or otherwise Privileged.
If you are not the intended recipient (or responsible for delivery of the
message to such person) : - (1) please immediately (i) notify the sender by
reply email and (ii) delete this message and attachments, - (2) any use, copy
or dissemination of this transmission is strictly prohibited. If you or your
employer does not consent to Internet email messages of this kind, please
advise Purple Labs by reply e-mail immediately. Opinions, conclusions and other
information expressed in this message are not given or endorsed by Purple Labs
unless otherwise indicated by an authorized representative independent of this
message.
_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison