* iostream question
@ 2002-10-15 3:50 Robert Schweikert
2002-10-15 4:29 ` Gabriel Dos Reis
0 siblings, 1 reply; 4+ messages in thread
From: Robert Schweikert @ 2002-10-15 3:50 UTC (permalink / raw)
To: gcc
I am trying to compile a large application with gcc 3.2, (porting from
gcc 2.95.2) and am getting errors like this.
/home/rjschwei/local/include/c++/3.2/backward/iostream.h:35: using
declaration
`ostream' introduced ambiguous type `ostream'
The application uses iostream.h, converting to iostream is not an option.At first glance it looks like most error come from template files.
Any hints on tracking this problem down are appreciated.
Thanks,
Robert
--
Robert Schweikert MAY THE SOURCE BE WITH YOU
rjschwei@cox.net LINUX
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: iostream question
2002-10-15 3:50 iostream question Robert Schweikert
@ 2002-10-15 4:29 ` Gabriel Dos Reis
2002-10-17 6:51 ` Robert Schweikert
0 siblings, 1 reply; 4+ messages in thread
From: Gabriel Dos Reis @ 2002-10-15 4:29 UTC (permalink / raw)
To: Robert Schweikert; +Cc: gcc
Robert Schweikert <rjschwei@cox.net> writes:
| I am trying to compile a large application with gcc 3.2, (porting from
| gcc 2.95.2) and am getting errors like this.
|
| /home/rjschwei/local/include/c++/3.2/backward/iostream.h:35: using
| declaration
| `ostream' introduced ambiguous type `ostream'
Did your application already declared ostream before #include <iostream.h>?
(I suspect that is the case). If so, then, you no option but delete
that forward-declaration.
-- Gaby
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: iostream question
2002-10-17 6:51 ` Robert Schweikert
@ 2002-10-17 6:51 ` Phil Edwards
0 siblings, 0 replies; 4+ messages in thread
From: Phil Edwards @ 2002-10-17 6:51 UTC (permalink / raw)
To: Robert Schweikert; +Cc: Gabriel Dos Reis, gcc
On Wed, Oct 16, 2002 at 08:52:53PM -0400, Robert Schweikert wrote:
> OK,
>
> Are you saying I can no longer forward declare an ostream?
Yes, but you don't want to forward declare an ostream anymore.
class ostream;
isn't legal, because it doesn't match the real ostream.
> That would mean that for a declaration like so
>
> ostream& operator<< (ostream&, const myClass);
>
> I have to include the iostream header file in my header file. That seems
> odd. There's got to be a better way.
There is, called <iosfwd>. All the I/O classes, forward declared.
Phil
--
I would therefore like to posit that computing's central challenge, viz. "How
not to make a mess of it," has /not/ been met.
- Edsger Dijkstra, 1930-2002
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: iostream question
2002-10-15 4:29 ` Gabriel Dos Reis
@ 2002-10-17 6:51 ` Robert Schweikert
2002-10-17 6:51 ` Phil Edwards
0 siblings, 1 reply; 4+ messages in thread
From: Robert Schweikert @ 2002-10-17 6:51 UTC (permalink / raw)
To: Gabriel Dos Reis; +Cc: gcc
OK,
Are you saying I can no longer forward declare an ostream?
That would mean that for a declaration like so
ostream& operator<< (ostream&, const myClass);
I have to include the iostream header file in my header file. That seems odd. There's got to be a better way.
Robert
Gabriel Dos Reis wrote:
>Robert Schweikert <rjschwei@cox.net> writes:
>
>| I am trying to compile a large application with gcc 3.2, (porting from
>| gcc 2.95.2) and am getting errors like this.
>|
>| /home/rjschwei/local/include/c++/3.2/backward/iostream.h:35: using
>| declaration
>| `ostream' introduced ambiguous type `ostream'
>
>Did your application already declared ostream before #include <iostream.h>?
>(I suspect that is the case). If so, then, you no option but delete
>that forward-declaration.
>
>-- Gaby
>
>
>
--
Robert Schweikert MAY THE SOURCE BE WITH YOU
rjschwei@cox.net LINUX
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-10-17 0:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-15 3:50 iostream question Robert Schweikert
2002-10-15 4:29 ` Gabriel Dos Reis
2002-10-17 6:51 ` Robert Schweikert
2002-10-17 6:51 ` Phil Edwards
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).