Last week,I tried to develop a simple parser using Flex and Bison for C- language.But when I try to compile it using "gcc -o myparser cm.tab.c lex.yy.c" in terminal, I got an error saying there are multiple definitions of main.
I've put main functions in both flex and bison files.Then I got to know that there should be only one main function and it can be included in any of those files.
When I remove "main" in flex file, that error was fixed and new error appeared saying "reference to yywrap is missing". Then I insert yywrap(){return (1);} to flex file and it woked!!
Subscribe to:
Post Comments (Atom)
0 Response to "flex and bison: "multiple definition of main" error"
Post a Comment