This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: g++ 3.0.1 does not compile the attached file but 2.96 does


Since gcc 3.0 is more standards compliant: list, string, cout, cerr,
and most other things included in standard headers are now in
the namespace of std, gcc 2.95.2 ignored this namespace unless
you passed it "-fhonor-std"

Thanks,
Andrew Pinski
Student of Computer Science at University of Cincinnati


On Monday, September 10, 2001, at 07:55 PM, Daqing Hou wrote:

> Originator Daqing Hou
>
> Synopsis g++ 3.0.1 does not compile the attached file but 2.96 does
>
> Category c++
>
> Release g++ 3.0.1
>
> Description
> [daqing@sunchild Observer]$ ~/cppx/execs/g++ Observer.cc
> In file included from Observer.cc:1:
> Subject.h:9: syntax error before `;' token
> Subject.h:10: syntax error before `::' token
> Subject.h:23: `string' was not declared in this scope
> Subject.h:23: parse error before `)' token
> Subject.h:25: 'string' is used as a type, but is not defined as a type.
> Subject.h:28: 'Olist' is used as a type, but is not defined as a type.
> Subject.h: In constructor `Subject::Subject()':
> Subject.h:15: class `Subject' does not have any field named `name'
> In file included from Observer.cc:2:
> Observer.h: At global scope:
> Observer.h:23: 'string' is used as a type, but is not defined as a type.
>
> Observer.cc: In member function `virtual void
> Observer::update(Subject*)':
> Observer.cc:9: `name' undeclared (first use this function)
> Observer.cc:9: (Each undeclared identifier is reported only once for
> each
>    function it appears in.)
> Observer.cc:9: `class Subject' has no member named `name'
> Observer.cc:10: `cout' undeclared (first use this function)
> Observer.cc:11: `endl' undeclared (first use this function)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]