Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > conflicting declaration for iostream, namespace conflict?

Reply
Thread Tools

conflicting declaration for iostream, namespace conflict?

 
 
humble04@gmail.com
Guest
Posts: n/a
 
      12-29-2004
Hi,

I am compiling a collection of C++ code. Most of them are using the new
format #include <iostream>. I think all of them because I failed at
finding out which header file uses the old format #include
<iostream.h>. However, I met the following error messages.

"/usr/vacpp/include/iostream.h", line 74.7: 1540-0400 (S) "class
ostream" has a conflicting declaration
"../include/myfile.h", line 7.1: 1540-0424 (I) "ostream" is declared on
line 7 of "../include/myfile.h".

in "myfile.h", it declares
#include <iostream>
using std::streambuf;
using std:stream;

The platform I am working on is IBM SP2 using xlC_r (VisualAge C++
Professional / C for AIX Compiler, Version 6).
Did you ever have similar problems? Thanks a lot.

Alex

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      12-29-2004
<(E-Mail Removed)> wrote...
> I am compiling a collection of C++ code. Most of them are using the new
> format #include <iostream>. I think all of them because I failed at
> finding out which header file uses the old format #include
> <iostream.h>. However, I met the following error messages.
>
> "/usr/vacpp/include/iostream.h", line 74.7: 1540-0400 (S) "class
> ostream" has a conflicting declaration
> "../include/myfile.h", line 7.1: 1540-0424 (I) "ostream" is declared on
> line 7 of "../include/myfile.h".
>
> in "myfile.h", it declares
> #include <iostream>
> using std::streambuf;
> using std:stream;
>
> The platform I am working on is IBM SP2 using xlC_r (VisualAge C++
> Professional / C for AIX Compiler, Version 6).
> Did you ever have similar problems? Thanks a lot.


Yes, I actually have seen something of the sort. It turned out that
in the old code I had to maintain, both <iostream> and <iostream.h>
were used without care. I had to weed out all uses of the old non-
standard header (<iostream.h>) and the problem had gone away.

Search through all source files and headers and remove non-standard
"library" headers like <iostream.h>. Standard C++ headers do not
have the '.h' in their names.

Victor


 
Reply With Quote
 
 
 
 
humble04@gmail.com
Guest
Posts: n/a
 
      12-29-2004
Thank you very much Victor. I finally found that I missed a small
header file in a subdirecotry that includes "iostream.h". The
conflicting problem is solved. What a good day .

Enjoy your holiday.

Alex
Victor Bazarov wrote:
> <(E-Mail Removed)> wrote...
> > I am compiling a collection of C++ code. Most of them are using the

new
> > format #include <iostream>. I think all of them because I failed at
> > finding out which header file uses the old format #include
> > <iostream.h>. However, I met the following error messages.
> >
> > "/usr/vacpp/include/iostream.h", line 74.7: 1540-0400 (S) "class
> > ostream" has a conflicting declaration
> > "../include/myfile.h", line 7.1: 1540-0424 (I) "ostream" is

declared on
> > line 7 of "../include/myfile.h".
> >
> > in "myfile.h", it declares
> > #include <iostream>
> > using std::streambuf;
> > using std:stream;
> >
> > The platform I am working on is IBM SP2 using xlC_r (VisualAge C++
> > Professional / C for AIX Compiler, Version 6).
> > Did you ever have similar problems? Thanks a lot.

>
> Yes, I actually have seen something of the sort. It turned out that
> in the old code I had to maintain, both <iostream> and <iostream.h>
> were used without care. I had to weed out all uses of the old non-
> standard header (<iostream.h>) and the problem had gone away.
>
> Search through all source files and headers and remove non-standard
> "library" headers like <iostream.h>. Standard C++ headers do not
> have the '.h' in their names.
>
> Victor


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error: conflicting declaration 'typedef int32_t ssize_t' (mingw versus berkeley db) Skybuck Flying C Programming 5 11-29-2011 09:07 PM
conflicting declaration in template static member Michael Doubez C++ 11 03-26-2011 02:01 PM
conflicting types or implicit declaration or incompatible implicitdeclaration dentzigui C Programming 8 11-01-2009 03:07 AM
previous declaration of Table was here / conflicting types for Michael.Z C Programming 11 05-11-2008 03:11 AM
maxplusII error: a deferred constant declaration without a full declaration is not supported Noah VHDL 5 04-07-2006 02:34 PM



Advertisments