title: Undefined Reference To yywrap
body: <p>I have a simple "language" that I'm using Flex(Lexical Analyzer), it's like this:</p>
  
  <pre><code>/* Just like UNIX wc */
  %{
  int chars = 0;
  int words = 0;
  int lines = 0;
  %}
  
  %%
  [a-zA-Z]+ { words++; chars += strlen(yytext); }
  \n        { chars++; lines++; }
  .         { chars++; }
  %%
  
  int main()
  {
      yylex();
      printf("%8d%8d%8d\n", lines, words, chars);
  }
  </code></pre>
  
  <p>The I run a <code>flex count.l</code>, all goes ok without errors or warnings, then when I try to do a <code>cc lex.yy.c</code> I got this errors:</p>
  
  <blockquote>
    <p>ubuntu@eeepc:~/Desktop$ cc lex.yy.c<br />
    /tmp/ccwwkhvq.o: In function <code>yylex':
    lex.yy.c:(.text+0x402): undefined reference to</code>yywrap'<br />
    /tmp/ccwwkhvq.o: In function <code>input':
    lex.yy.c:(.text+0xe25): undefined reference to</code>yywrap'<br />
    collect2: ld returned 1 exit status</p>
  </blockquote>
  
  <p><strong>What is wrong?</strong></p>