This question is similar to this one but for yyparse, not yylex.
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 'yyparse' was not declared in this scope
. I've tried defining the variable as global but it doesn't seem to work.
In the Flex file I tried:
extern "C" {
int yyparse();
}
and this in the Bison file:
extern int yyparse();
but it didn't do anything.
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?