title: gcc error : undefined reference to `itoa'
body: <p>if I include stdlib.h then also itoa() is not recognized. My code : </p>
  
  <pre><code>%{
  #include "stdlib.h"
  #include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  int yylex(void);
  char p[10]="t",n1[10];
  int n ='0';
  
  %}
  %union
  {
  char *dval;
  }
  %token ID
  %left '+' '-'
  %left '*' '/'
  %nonassoc UMINUS
  %type &lt;dval&gt; S
  %type &lt;dval&gt; E
  %%
  S : ID '=' E {printf(" x = %sn",$$);}
  ;
  E : ID {}
  | E '+' E {n++;itoa(n,n1,10);printf(" %s = %s + %s ",p,$1,$3);strcpy($$,p);strcat($$,n1);}
  | E '-' E {n++;itoa(n,n1,10);printf(" %s = %s – %s ",p,$1,$3);strcpy($$,p);strcat($$,n1);}
  | E '*' E {n++;itoa(n,n1,10);printf(" %s = %s * %s ",p,$1,$3);strcpy($$,p);strcat($$,n1);}
  | E '/' E {n++;itoa(n,n1,10);printf(" %s = %s / %s ",p,$1,$3);strcpy($$,p);strcat($$,n1);}
  ;
  %%
  
  main()
  {
  yyparse();
  }
  
  int yyerror (char *s)
  
  
  {
  
  
  }
  </code></pre>
  
  <p>After running the code I got :</p>
  
  <pre><code>gcc lex.yy.c y.tab.c -ll
  12.y: In function ‘yyparse’:
  12.y:24: warning: incompatible implicit declaration of built-in function ‘strcpy’
  12.y:24: warning: incompatible implicit declaration of built-in function ‘strcat’
  12.y:25: warning: incompatible implicit declaration of built-in function ‘strcpy’
  12.y:25: warning: incompatible implicit declaration of built-in function ‘strcat’
  12.y:26: warning: incompatible implicit declaration of built-in function ‘strcpy’
  12.y:26: warning: incompatible implicit declaration of built-in function ‘strcat’
  12.y:27: warning: incompatible implicit declaration of built-in function ‘strcpy’
  12.y:27: warning: incompatible implicit declaration of built-in function ‘strcat’
  /tmp/ccl0kjje.o: In function `yyparse':
  y.tab.c:(.text+0x33d): undefined reference to `itoa'
  y.tab.c:(.text+0x3bc): undefined reference to `itoa'
  y.tab.c:(.text+0x43b): undefined reference to `itoa'
  y.tab.c:(.text+0x4b7): undefined reference to `itoa'
  </code></pre>
  
  <p>Where am I going wrong ? Why cant it find the reference to itoa ? I have also tried with &lt;> brackets for itoa.</p>