I’ve been banging my head all day trying to fix this. I have a bison/flex/c++ project I’m working on, ignoring the fact that the semantic actions are incomplete and will cause compile errors when it gets there, I can’t get the generated parser to compile. I get the following:
g++ -I. -g3 -std=c++0x -DYYDEBUG=1 -Werror -Wfatal-errors -pipe -fomit-frame-pointer -D_FORTIFY_SOURCE=2 -fstack-protector-all -o ndes.bin Parser.cpp Scanner.cpp Driver.cpp
Parser.cpp:174:3: error: prototype for ‘nde::script::Parser::Parser(nde::script::Driver&)’ does not match any in class ‘nde::script::Parser’
compilation terminated due to -Wfatal-errors.
make: *** [all] Error 1
Now, judging from the error, I thought it would be straight forward to fix: the header file doesn’t match the source file. So, I open them up, and I can’t find a difference between them.
The full source to my project is in the github link above, using the “rework” branch under the “script” folder. I’m using g++ 4.6.1, flex 2.5.35, and bison 2.4.1. The files in question are Parser.[ch]pp which are generated by bison.
Thank you for any help.
Forward-declare
class Driverin the namespace.