the C++ mode of flex 2.5.4a is broken. It generates non-ISO conformant C++ code which makes any recent gcc barf.
The problem seems to be not GnuWin32 specific, but that's I ran into it (full force), so why not save you folks some trouble. Patching is simple though:
(1) in flex.skl, replace the line "class istream;"
with these two lines:
include <iosfwd>
using namespace std;
(2) in FlexLexer.h, replace all occurences of "istream" with "std::istream" and ditto "ostream" with "std::ostream"
This link has some explanation on what goes wrong: http://tinyurl.com/m7oet. However the poster only presented part (1) of the patch. I needed (2)
too to get it to work.
If somebody tells me how to submit a formal patch, I'll do it (one day).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
the C++ mode of flex 2.5.4a is broken. It generates non-ISO conformant C++ code which makes any recent gcc barf.
The problem seems to be not GnuWin32 specific, but that's I ran into it (full force), so why not save you folks some trouble. Patching is simple though:
(1) in flex.skl, replace the line "class istream;"
with these two lines:
include <iosfwd>
using namespace std;
(2) in FlexLexer.h, replace all occurences of "istream" with "std::istream" and ditto "ostream" with "std::ostream"
This link has some explanation on what goes wrong:
http://tinyurl.com/m7oet. However the poster only presented part (1) of the patch. I needed (2)
too to get it to work.
If somebody tells me how to submit a formal patch, I'll do it (one day).
Will this ever get fixed? Anyone?
In the next release / version of flex.