472,364 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,364 software developers and data experts.

conflicting declaration for iostream, namespace conflict?

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::ostream;

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

Jul 22 '05 #1
2 3829
<hu******@gmail.com> 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::ostream;

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
Jul 22 '05 #2
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:
<hu******@gmail.com> 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::ostream;

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


Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John Ky | last post by:
Hello: Building Python works fine. Now I am trying to build my own python module on Solaris 9, but I'm getting the following conflict: In file included from...
2
by: Jacek Dziedzic | last post by:
Is it valid to use a "using namespace foo" (as opposed to using foo::bar which I'm sure is legal) within a class declaration? My compiler rejects it, but I've been told it's valid. Can anyone...
9
by: ai | last post by:
Hi , I have an application which has to read files of size few mba nd read them into array . Since i am using STL and std namespace to avoid the error error C2872: 'ifstream' : ambiguous...
6
by: user | last post by:
Hi, I got this error and donno know how to fix it: In file included from ../except.h:53, from group.c:22: .../portspecs.h:81: error: conflicting types for `const double __infinity'...
2
by: Plok Plokowitsch | last post by:
After over a decade of programming in C++ I seem to have missed some substantial point (mental note: am I getting too old for this?). A little bit of help would be *very* appreciated. I'm trying...
4
by: Juhan Voolaid | last post by:
Hi I need help here. When i compile my program, i get this error: $ make g++ -c -Wall inf2_functions.cpp -o inf2_functions.o inf2_classes.h:6: error: ISO C++ forbids declaration of ‘vector’...
8
by: Lathe_Biosas | last post by:
Hi While compiling my application that needs "windows.h" there are some typedef redefinition errors redefinition at winnt.h( line 207) typedef void *HANDLE redefinition at windef.h( line...
11
by: alex sparsky | last post by:
I have a rather unique problem that I need some advice on. I have multiple c# controls that need to make use of a common namespace. So when I go to include both controls that make use of that...
2
by: Layton | last post by:
Hi, CPP gurus, How to use friend function cross the namespace? I have the following sample code with operator << overloaded, it's working. The problem the operator << function can't access...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.