title: Bison conflicting type for yyerror
body: <p>I'm trying to make a calculator from flex and bison, but I found an error during the compile.</p>
  
  <p>Here is the error:</p>
  
  <pre><code>C:\GnuWin32\src&gt;gcc lex.yy.c y.tab.c -o tugas
  tugas.y:51: error: conflicting types for 'yyerror'
  y.tab.c:1433: error: previous implicit declaration of 'yyerror' was here
  </code></pre>
  
  <p>Here is my .l code :</p>
  
  <pre><code>%{
  #include &lt;stdio.h&gt;
  #include "y.tab.h"
  YYSTYPE yylval;
  %}
  plus    [+]
  semi    [;]
  minus   [-]
  var [a-z]
  digit   [0-1]+
  equal   [:=]
  %%
  {var}   {yylval = *yytext - 'a'; return VAR;}
  {digit} {yylval = atoi(yytext); return DIGIT;}
  {plus}  {return PLUS;}
  {minus} {return MINUS;}
  {equal} {return EQUAL;}
  {semi}  {return SEMI;}
   .  { return *yytext; }
  %%
  int main(void)
  {
   yyparse();
   return 0;
  }
  
  int yywrap(void)
  {
   return 0;
  }
  
  int yyerror(void) 
  {
    printf("Error\n");
    exit(1);
  }
  </code></pre>
  
  <p>And here is my .y code :</p>
  
  <pre><code>%{
  int sym[26];
  %}
  
  %token DIGIT VAR
  %token MINUS PLUS EQUAL
  %token SEMI 
  
  %%
  
  program: dlist SEMI slist
  ;
  
  dlist:  /* nothing */
  | decl SEMI dlist
  ;
  
  decl:   'VAR' VAR   {printf("deklarasi variable accepted");}
  ;
  
  slist:  stmt
  | slist SEMI stmt
  ;
  
  stmt:   VAR EQUAL expr   {sym[$1] = $3;}
  | 'PRINT' VAR   {printf("%d",sym[$2]);}
  ;
  
  expr:   term    {$$ = $1;}
  | expr PLUS term    { $$ = $1 + $3;}
  | expr MINUS term   { $$ = $1 - $3; }
  ;
  
  term:   int {$$ = $1;}
  | VAR   {$$ = sym[$1]; }
  ;
  
  int:    DIGIT   {$$ = $1;}
  | int DIGIT
  ;
  </code></pre>
  
  <p>Why I am getting this error? any suggestion to overcome this issue.<br>Thanks in advance</p>