Menu

#1 Build problems with GCC 3.2.2 and Flex++ 2.5.4

open
nobody
None
5
2003-03-26
2003-03-26
No

Build process of 2.7.9-3 currently fails on Debian (with GCC
3.2.2 and Flex++ 2.5.4a) because of some std::namespace
problems. It looks like the code that Flex generates contains
colliding references to both std::-prefixed [i|o]stream class and
typedef'd versions with unpleasant consequences:

...
flex++ -oconf_analysis_yy.cpp conf_analysis.yy
g++ -c -O2 -fmessage-length=60 -I/usr/include/qt3
conf_analysis_yy.cpp
conf_analysis_yy.cpp: In member function `virtual int
yyFlexLexer::yylex()':
conf_analysis_yy.cpp:890: cannot convert `std::istream*' to
`istream*' in assignment
conf_analysis_yy.cpp: At global scope:
conf_analysis_yy.cpp:998: syntax error before `*' token
conf_analysis_yy.cpp:1001: ISO C++ forbids declaration of `
yyout' with no type
conf_analysis_yy.cpp:1001: `arg_yyout' was not declared in
this scope
conf_analysis_yy.cpp:1002: ISO C++ forbids declaration of `
yy_c_buf_p' with no type
conf_analysis_yy.cpp:1003: ISO C++ forbids declaration of `
yy_init' with no type
conf_analysis_yy.cpp:1004: ISO C++ forbids declaration of `
yy_start' with no type
conf_analysis_yy.cpp:1005: ISO C++ forbids declaration of `
yy_flex_debug' with no type
conf_analysis_yy.cpp:1006: ISO C++ forbids declaration of `
yylineno' with no type
conf_analysis_yy.cpp:1008: ISO C++ forbids declaration of `
yy_did_buffer_switch_on_eof' with no type
conf_analysis_yy.cpp:1010: ISO C++ forbids declaration of `
yy_looking_for_trail_begin' with no type
conf_analysis_yy.cpp:1011: ISO C++ forbids declaration of `
yy_more_flag' with no type
conf_analysis_yy.cpp:1012: ISO C++ forbids declaration of `
yy_more_len' with no type
conf_analysis_yy.cpp:1013: ISO C++ forbids declaration of `
yy_more_offset' with no type
conf_analysis_yy.cpp:1013: invalid use of member `
yyFlexLexer::yy_prev_more_offset'
conf_analysis_yy.cpp:1015: ISO C++ forbids declaration of `
yy_start_stack_ptr' with no type
conf_analysis_yy.cpp:1015: invalid use of member `
yyFlexLexer::yy_start_stack_depth'
conf_analysis_yy.cpp:1016: ISO C++ forbids declaration of `
yy_start_stack' with no type
conf_analysis_yy.cpp:1018: ISO C++ forbids declaration of `
yy_current_buffer' with no type
conf_analysis_yy.cpp:1021: ISO C++ forbids declaration of `
yy_state_buf' with no type
conf_analysis_yy.cpp:1021: invalid conversion from `
yy_state_type*' to `int'
conf_analysis_yy.cpp:1025: syntax error before `}' token
conf_analysis_yy.cpp:1033: use of `istream' is ambiguous
conf_analysis_yy.cpp:25: first declared as `struct
istream' here
/usr/include/c++/3.2/iosfwd:107: also declared as `
typedef struct std::basic_istream<char,
std::char_traits<char> > std::istream' here
conf_analysis_yy.cpp:1033: `istream' denotes an ambiguous
type
conf_analysis_yy.cpp:25: first type here
/usr/include/c++/3.2/iosfwd:58: other type here
conf_analysis_yy.cpp:1033: `new_in' was not declared in
this scope
conf_analysis_yy.cpp:1033: syntax error before `*' token
conf_analysis_yy.cpp:1034: prototype for `void
yyFlexLexer::switch_streams(...)' does not match any in
class `yyFlexLexer'
/usr/include/FlexLexer.h:117: candidate is: virtual void
yyFlexLexer::switch_streams(std::istream*,
std::ostream*)
conf_analysis_yy.cpp: In member function `void
yyFlexLexer::switch_streams(...)':
conf_analysis_yy.cpp:1035: `new_in' undeclared (first use
this function)
conf_analysis_yy.cpp:1035: (Each undeclared identifier is
reported only once for each function it appears in.)
conf_analysis_yy.cpp:1041: `new_out' undeclared (first use
this function)
conf_analysis_yy.cpp: At global scope:
conf_analysis_yy.cpp:1380: use of `istream' is ambiguous
conf_analysis_yy.cpp:25: first declared as `struct
istream' here
/usr/include/c++/3.2/iosfwd:107: also declared as `
typedef struct std::basic_istream<char,
std::char_traits<char> > std::istream' here
conf_analysis_yy.cpp:1380: `istream' denotes an ambiguous
type
conf_analysis_yy.cpp:25: first type here
/usr/include/c++/3.2/iosfwd:58: other type here
conf_analysis_yy.cpp:1380: `input_file' was not declared in
this scope
conf_analysis_yy.cpp:1381: variable or field `yyrestart'
declared void
conf_analysis_yy.cpp:1381: `int yyFlexLexer::yyrestart' is
not a static member of `class yyFlexLexer'
conf_analysis_yy.cpp:1381: syntax error before `{' token
conf_analysis_yy.cpp:1385: invalid use of member `
yyFlexLexer::yy_current_buffer'
conf_analysis_yy.cpp:1385: `input_file' was not declared in
this scope
conf_analysis_yy.cpp:1385: ISO C++ forbids declaration of `
yy_init_buffer' with no type
conf_analysis_yy.cpp:1385: initializer list being treated
as compound expression
conf_analysis_yy.cpp:1386: ISO C++ forbids declaration of `
yy_load_buffer_state' with no type
conf_analysis_yy.cpp:1387: syntax error before `}' token
conf_analysis_yy.cpp: In member function `void
yyFlexLexer::yy_load_buffer_state()':
conf_analysis_yy.cpp:1419: cannot convert `istream*' to `
std::istream*' in assignment
conf_analysis_yy.cpp: At global scope:
conf_analysis_yy.cpp:1424: use of `istream' is ambiguous
conf_analysis_yy.cpp:25: first declared as `struct
istream' here
/usr/include/c++/3.2/iosfwd:107: also declared as `
typedef struct std::basic_istream<char,
std::char_traits<char> > std::istream' here
conf_analysis_yy.cpp:1424: `istream' denotes an ambiguous
type
conf_analysis_yy.cpp:25: first type here
/usr/include/c++/3.2/iosfwd:58: other type here
conf_analysis_yy.cpp:1424: `file' was not declared in this
scope
conf_analysis_yy.cpp:1424: syntax error before `)' token
conf_analysis_yy.cpp:1425: prototype for `yy_buffer_state*
yyFlexLexer::yy_create_buffer(...)' does not match any
in class `yyFlexLexer'
/usr/include/FlexLexer.h:112: candidate is: virtual
yy_buffer_state*
yyFlexLexer::yy_create_buffer(std::istream*, int)
conf_analysis_yy.cpp: In member function `yy_buffer_state*
yyFlexLexer::yy_create_buffer(...)':
conf_analysis_yy.cpp:1432: `size' undeclared (first use
this function)
conf_analysis_yy.cpp:1443: `file' undeclared (first use
this function)
conf_analysis_yy.cpp: At global scope:
conf_analysis_yy.cpp:1464: type specifier omitted for
parameter `istream'
conf_analysis_yy.cpp:1464: syntax error before `*' token
conf_analysis_yy.cpp:1466: prototype for `void
yyFlexLexer::yy_init_buffer(...)' does not match any in
class `yyFlexLexer'
/usr/include/FlexLexer.h:128: candidate is: void
yyFlexLexer::yy_init_buffer(yy_buffer_state*,
std::istream*)
conf_analysis_yy.cpp: In member function `void
yyFlexLexer::yy_init_buffer(...)':
conf_analysis_yy.cpp:1467: `b' undeclared (first use this
function)
make: *** [conf_analysis_yy.o] Error 1

Discussion

  • Nobody/Anonymous

    Logged In: NO

    try to change the line

    class istream;
    in the file conf_analysis_yy.cpp to

    #include <iostream.h>

     
  • Jarno Elonen

    Jarno Elonen - 2003-04-13

    Logged In: YES
    user_id=312071

    That helped but I'm patching a source package and would like a fix that
    doesn't require modifying generated files. Further ideas?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.