title: Bison/Yacc: yyparse not declared in this scope
body: <p>This question is similar to <a href="https://stackoverflow.com/questions/1596239/simple-flex-bison-c">this one</a> but for yyparse, not yylex.</p>
  
  <p>I've been battling with this for hours now!  I'm wanting to call yyparse from a C program (actually a C++ one but I ended up using the old flex/bison rather than the newer ones for C++ woops (didn't realise the C++ versions even existed)).  The only error is that <code>'yyparse' was not declared in this scope</code>.  I've tried defining the variable as global but it doesn't seem to work.</p>
  
  <p>In the Flex file I tried:</p>
  
  <pre><code>extern "C" {
    int yyparse();
  }
  </code></pre>
  
  <p>and this in the Bison file:</p>
  
  <pre><code>extern int yyparse();
  </code></pre>
  
  <p>but it didn't do anything.</p>
  
  <p>So.. I think I'm linking wrong.  The problem is that I am using Qt which builds the make file automatically so I can't edit it without it just being overritten again.   Is there any way of fixing the problem without changing the linking?  If not, how is the linking meant to be done?</p>