Version: (using KDE KDE 3.1.94) Installed from: Compiled From Sources Compiler: gcc.3.3.1 OS: Linux This happens while trying to compile kdesdk-3.1.94. This happens both with and without --enable-final. In file included from /usr/include/c++/3.3.1/backward/iostream.h:31, from /usr/local/include/FlexLexer.h:47, from pofiles.cc:241: /usr/include/c++/3.3.1/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated. In file included from /usr/local/include/FlexLexer.h:47, from pofiles.cc:241: /usr/include/c++/3.3.1/backward/iostream.h:36: error: `istream' is already declared in this scope /usr/include/c++/3.3.1/backward/iostream.h:36: error: using declaration ` istream' introduced ambiguous type `istream' pofiles.cc:401:5: warning: "YY_STACK_USED" is not defined pofiles.cc: In member function `virtual int GettextBaseFlexLexer::yylex()': pofiles.cc:683: error: cannot convert `std::istream*' to `istream*' in assignment pofiles.cc: In member function `void GettextBaseFlexLexer::yy_load_buffer_state()': pofiles.cc:1216: error: cannot convert `istream*' to `std::istream*' in assignment pofiles.cc: In member function `void GettextBaseFlexLexer::yy_init_buffer(yy_buffer_state*, std::istream*)': pofiles.cc:1267: error: cannot convert `std::istream*' to `istream*' in assignment pofiles.cc:1458:5: warning: "YY_MAIN" is not defined make[2]: *** [pofiles.lo] Error 1 make[2]: Leaving directory `/usr/src/kdesdk-3.1.94/kbabel/common/libgettext' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/src/kdesdk-3.1.94/kbabel/common' make: *** [all-recursive] Error 1
If you upgrade your GNU flex, does it work? This problem is caused by GNU flex being incompatible with the stricter C++ requirements of your g++ 3.2 or up. Can you also verify if pofiles.cc was already present in your packages or if it was generated? (or both?)
My flex version is 2.5.4 (and I can't find newer one). pofiles.cc is generated.
Using this patch on flex 2.5.4a : http://lfs.crash404.com/patches/downloads/flex/flex-2.5.4a-redhat-fixes.patch make kbabel compile with gcc 3.3.x.
Confirm, no errors anymore. Maybe you should include generated pofiles.cc in source distribution since most people won't have this patch applied?
No, if you've updated gcc, you should consider to update flex as well. It does not make sense if you have a new gcc and old flex, which generates invalid code for you gcc. *** This bug has been marked as a duplicate of 62895 ***
The problem is that the newest version of flex is 2.5.4a from 1997 (ftp://ftp.gnu.org/pub/gnu/non-gnu/flex, correct me if there is newer version available). And believe me, there are people who simple don't use packages or even don't use any specific distribution (consider LFS).
Yes, you are right that 2.54a is the latest "stable" flex. And I do believe there are people that don't use distros. Simply, I cannot add a file, that will compile with all flex versions. That's the problem!
What about adding a test to configure or even a notice in README and including this patch (or its url)? I think it could be fine solution ...
If you have faulty programs installed, it's not our fault. This problem has also appeared several times here in the bug tracking system, so people can find it if they don't simply file reports away without checking for duplicates. As for the generated file, it's KDE policy that they be included in the tarballs and CVS. That means this pofiles.cc should be in CVS. That is, I hope flex 2.5.4a generates files that old g++ versions can compile as well as new ones.
It doesn't and that's the whole problem. It works only if you patch flex with this redhat patch.