parsing - How do I get rid of this duplicate declaration of YYSTYPE? -


here relevant error:

grammar.y:72: error: conflicting declaration ‘typedef union yystype yystype’ y.tab.h:83: error: ‘yystype’ has previous declaration ‘typedef union yystype yystype’ make: *** [y.tab.o] error 1 

i using flex , byacc produce translator. build has structure:

  1. make y.tab.h grammar.y file.
  2. include y.tab.h in tokens.lex file, , compile produce lex.yy.c.
  3. include lex.yy.c in grammar file. way, can see yylex.

what seems happening this: y.tab.h contains union declaration of yystype union. gets included lex.yy.c, gets included grammar.y. @ same time, grammar.y producing own version of union, , 2 clash.

is not standard approach? there need change make build correctly?

oops. turns out wasn't compiling bison. other system had yacc symlinked bison, had change makefile use bison rather yacc.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -