title: C error with Flex: type specifier missing?
body: <p>Running the code below in iTerm2 bash. Code file was created using Vim.</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++; }
  
  %%
  
   main(int argc, char **argv)
  {
    yylex();
    printf("%8d%8d%8d\n", lines, words, chars);
  }
  </code></pre>
  
  <p>I ran commands</p>
  
  <pre><code>$flex fb1-1.1
  $cc lex.yy.c -lfl
  </code></pre>
  
  <p>This is the error that it returns</p>
  
  <pre><code>fb1-1.1:17:1: warning: type specifier missing, defaults to 'int'
    [-Wimplicit-int]
  main(int argc, char **argv)
  ^
  1 warning generated.
  ld: library not found for -lfl
  clang: error: linker command failed with exit code 1 (use -v to see       invocation)
  </code></pre>
  
  <p>EDIT: Works now. Changed the main() to </p>
  
  <pre><code>int main(int argc, char* argv[])
  </code></pre>
  
  <p>Also ran changed -lfl to -ll  </p>
  
  <pre><code>$flex fb1-1.1
  $cc lex.yy.c -ll
  $./a.out
  this is a text
  ^D
  1   4    15 
  </code></pre>