473,396 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

error C2872: 'streambuf' : ambiguous symbol Problem

HI,
I am a beginner in VC++..
I am trying to write a Win32 console application in visual studio..
I am using following header files..

#include <STRING>
using namespace std;

#include <hash_map>//from Standard template library
//and some other headers

When i complie my code , i am getting the follwing errors ...

c:\program files\microsoft visual studio\vc98\include\istream.h(102) :
error C2872: 'streambuf' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(117) :
error C2872: 'streampos' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(118) :
error C2872: 'streamoff' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(119) :
error C2872: 'streampos' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(126) :
error C2872: 'streambuf' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(132) :
error C2872: 'ios' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(139) :
error C2872: 'istream' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(140) :
error C2872: 'istream' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(140) :
error C2872: 'ios' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(140) :
error C2872: 'ios' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(142) :
error C2872: 'istream' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(143) :
error C2872: 'istream' : ambiguous symbol
-----and so on...
Error executing cl.exe.

ChatServer.obj - 102 error(s), 0 warning(s)

------------------
If i comment any one of those header files, it's compiled with no
errors....
But i need those two headers to be included (Becoz, hash_map.h is being
used for hash data structures and string.h using namespace std. is
being used in some ou_thread.h which is for threads )..

How can i solve this problem?...
Plz help me out ..

Thanx in advance..

With reagrds
Prasad

Jun 9 '06 #1
9 13227
Prasad wrote:
I am a beginner in VC++..
You might then find 'microsoft.public.vc.*' hierarchy of newsgroups
useful as well...
I am trying to write a Win32 console application in visual studio..
I am using following header files..

#include <STRING>
I don't know of a standard header <STRING>. There is <string>, and
since C++ is case-sensitive language, I believe it has to be spelled
as specified. It is possible that you employed some kind of compiler
extensions, of course...
using namespace std;

#include <hash_map>//from Standard template library
//and some other headers

When i complie my code , i am getting the follwing errors ...

c:\program files\microsoft visual studio\vc98\include\istream.h(102) :
'istream.h' looks suspicious. Is it an older, pre-standard header (when
many of them had '.h' after the name)? Is it possible that you're using
<hash_map> from the source that is very old, pre-standard? Well, there
is no *standard* header <hash_map>, but some old sources might be written
to use old pre-standard headers like 'istream.h' (which looks like one).
error C2872: 'streambuf' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(117) :
error C2872: 'streampos' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(118) :
error C2872: 'streamoff' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(119) :
error C2872: 'streampos' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(126) :
error C2872: 'streambuf' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(132) :
error C2872: 'ios' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(139) :
error C2872: 'istream' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(140) :
error C2872: 'istream' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(140) :
error C2872: 'ios' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(140) :
error C2872: 'ios' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(142) :
error C2872: 'istream' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\istream.h(143) :
error C2872: 'istream' : ambiguous symbol
-----and so on...
Error executing cl.exe.

ChatServer.obj - 102 error(s), 0 warning(s)

------------------
If i comment any one of those header files, it's compiled with no
errors....
That seems to indicate a conflict of dependencies. Make sure you have
the latest version of <hash_map> (wherever it is you got it from).
But i need those two headers to be included (Becoz, hash_map.h is
being used for hash data structures and string.h using namespace
Note, none of them are actually ".h".
std. is being used in some ou_thread.h which is for threads )..

How can i solve this problem?...


You need to get in touch with makers of <hash_map> and see if they have
anything newer.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 9 '06 #2
* Prasad:
I am a beginner in VC++..
I am trying to write a Win32 console application in visual studio..
I am using following header files..

#include <STRING>
using namespace std;

#include <hash_map>//from Standard template library
Note that this is not (yet) a standard library header, but a common
library extension.

//and some other headers

When i complie my code , i am getting the follwing errors ...

c:\program files\microsoft visual studio\vc98\include\istream.h(102) :
error C2872: 'streambuf' : ambiguous symbol


It looks like you have written

#include <iostream.h>

instead of

#include <iostream>

and that you are using an old version of your compiler that still has
the old, non-standard <iostream.h> header available.

Try to correct that (if my assumption about your compiler is correct, I
also recommend upgrading the compiler -- it's free).

If using standard <iostream> doesn't help, post a minimal and complete
program that reproduces the problem.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jun 9 '06 #3
HI Victor Bazzrow ,

Thanx for ur reply..

That seems to indicate a conflict of dependencies. Make sure you have
the latest version of <hash_map> (wherever it is you got it from).

I got this <hash_map> from sgi latest version which is updated in June
8, 2000
But i need those two headers to be included (Becoz, hash_map.h is
being used for hash data structures and string.h using namespace


Note, none of them are actually ".h".


Ya the two headers I am using are "no.h " files only..
std. is being used in some ou_thread.h which is for threads )..

How can i solve this problem?...


You need to get in touch with makers of <hash_map> and see if they have
anything newer.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


Jun 9 '06 #4
HI Victor Bazzrow ,

Thanx for ur reply..

That seems to indicate a conflict of dependencies. Make sure you have
the latest version of <hash_map> (wherever it is you got it from).

I got this <hash_map> from sgi latest version which is updated in June
8, 2000
But i need those two headers to be included (Becoz, hash_map.h is
being used for hash data structures and string.h using namespace


Note, none of them are actually ".h".


Ya the two headers I am using are "no.h " files only..
std. is being used in some ou_thread.h which is for threads )..

How can i solve this problem?...


You need to get in touch with makers of <hash_map> and see if they have
anything newer.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


Jun 9 '06 #5
HI Victor Bazzrow ,

Thanx for ur reply..

That seems to indicate a conflict of dependencies. Make sure you have
the latest version of <hash_map> (wherever it is you got it from).

I got this <hash_map> from sgi latest version which is updated in June
8, 2000
But i need those two headers to be included (Becoz, hash_map.h is
being used for hash data structures and string.h using namespace


Note, none of them are actually ".h".


Ya the two headers I am using are "no.h " files only..
std. is being used in some ou_thread.h which is for threads )..

How can i solve this problem?...


You need to get in touch with makers of <hash_map> and see if they have
anything newer.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


Jun 9 '06 #6
HI Alf P. Steinbach ,
Thanx for ur reply,
Alf P. Steinbach wrote:
* Prasad:
I am a beginner in VC++..
I am trying to write a Win32 console application in visual studio..
I am using following header files..

#include <STRING>
using namespace std;

#include <hash_map>//from Standard template library
Note that this is not (yet) a standard library header, but a common
library extension.

//and some other headers

When i complie my code , i am getting the follwing errors ...

c:\program files\microsoft visual studio\vc98\include\istream.h(102) :
error C2872: 'streambuf' : ambiguous symbol


It looks like you have written

#include <iostream.h>

instead of

#include <iostream>


Yes , I am using <iostraem> only..
and that you are using an old version of your compiler that still has
the old, non-standard <iostream.h> header available.

Try to correct that (if my assumption about your compiler is correct, I
also recommend upgrading the compiler -- it's free).

If using standard <iostream> doesn't help, post a minimal and complete
program that reproduces the problem.

A minimal program that reproduces the problem is
the one I have described above itself..

#include <STRING>
using namespace std;
#include <hash_map>

If i try to compile these 2 lines also , I am getting the same problem
.....

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


Jun 9 '06 #7
* Prasad:
[quoting signature etc.]
Please don't quote signatures.
* Prasad:
A minimal program that reproduces the problem is
the one I have described above itself..

#include <STRING>
using namespace std;
#include <hash_map>

If i try to compile these 2 lines also , I am getting the same problem
....


It compiles fine with Visual C++ 7.1, even with the uppercase "STRING"
(which should be lowercase).

I suggest you upgrade or downgrade your compiler, whichever version it is.

As a temporary solution it might work to just remove the "using
namespace std;" directive, or move it after all #include's.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jun 9 '06 #8

Alf P. Steinbach wrote:
* Prasad:
[quoting signature etc.]


Please don't quote signatures.
* Prasad:

A minimal program that reproduces the problem is
the one I have described above itself..

#include <STRING>
using namespace std;
#include <hash_map>

If i try to compile these 2 lines also , I am getting the same problem
....


It compiles fine with Visual C++ 7.1, even with the uppercase "STRING"
(which should be lowercase).

I suggest you upgrade or downgrade your compiler, whichever version it is.

As a temporary solution it might work to just remove the "using
namespace std;" directive, or move it after all #include's.


hi,
Thanx for ur reply..
I moved using namespace std after all #include's.
those errors have been removed...

But , now I am getting a new list of errors...
c:\program files\microsoft visual studio\vc98\include\utility(27) :
error C2953: 'pair' : template class has already been defined
c:\program files\microsoft visual
studio\vc98\include\utility(27) : see declaration of 'pair'
c:\program files\microsoft visual studio\vc98\include\utility(31) :
error C2995: '==' : template function has already been defined
c:\program files\microsoft visual
studio\vc98\include\stl\stl_pair.h(53) : see declaration of '=='
c:\program files\microsoft visual studio\vc98\include\utility(40) :
error C2995: '<' : template function has already been defined
c:\program files\microsoft visual
studio\vc98\include\stl\stl_pair.h(59) : see declaration of '<'
c:\program files\microsoft visual studio\vc98\include\utility(55) :
error C2995: 'make_pair' : template function has already been defined
c:\program files\microsoft visual
studio\vc98\include\stl\stl_pair.h(90) : see declaration of 'make_pair'
c:\program files\microsoft visual studio\vc98\include\utility(57) :
error C2011: 'input_iterator_tag' : 'struct' type redefinition
c:\program files\microsoft visual studio\vc98\include\utility(58) :
error C2011: 'output_iterator_tag' : 'struct' type redefinition
c:\program files\microsoft visual studio\vc98\include\utility(60) :
error C2011: 'forward_iterator_tag' : 'struct' type redefinition
c:\program files\microsoft visual studio\vc98\include\utility(62) :
error C2011: 'bidirectional_iterator_tag' : 'struct' type redefinition
c:\program files\microsoft visual studio\vc98\include\utility(64) :
error C2011: 'random_access_iterator_tag' : 'struct' type redefinition
c:\program files\microsoft visual studio\vc98\include\utility(71) :
error C2982: 'iterator' : new template parameter list has less
parameters than the previous declaration
c:\program files\microsoft visual
studio\vc98\include\utility(71) : see declaration of 'iterator'
c:\program files\microsoft visual studio\vc98\include\utility(71) :
error C2953: 'iterator' : template class has already been defined
c:\program files\microsoft visual
studio\vc98\include\utility(71) : see declaration of 'iterator'
c:\program files\microsoft visual studio\vc98\include\utility(174) :
error C2983: 'reverse_iterator' : new template parameter list has more
parameters than the previous declaration
c:\program files\microsoft visual
studio\vc98\include\utility(174) : see declaration of
'reverse_iterator'
c:\program files\microsoft visual studio\vc98\include\utility(174) :
error C2953: 'reverse_iterator' : template class has already been
defined
c:\program files\microsoft visual
studio\vc98\include\utility(174) : see declaration of
'reverse_iterator'
c:\program files\microsoft visual studio\vc98\include\utility(180) :
error C2995: '==' : template function has already been defined
c:\program files\microsoft visual
studio\vc98\include\stl\stl_iterator.h(498) : see declaration of '=='
c:\program files\microsoft visual studio\vc98\include\utility(192) :
error C2995: '<' : template function has already been defined
c:\program files\microsoft visual
studio\vc98\include\stl\stl_iterator.h(509) : see declaration of '<'
c:\program files\microsoft visual studio\vc98\include\utility(291) :
error C2504: 'iterator<struct std::output_iterator_tag,void,void>' :
base class undefined
c:\program files\microsoft visual
studio\vc98\include\utility(318) : see reference to class template
instantiation 'std::ostreambuf_iterator<_E,_Tr>' being compiled
c:\program files\microsoft visual studio\vc98\include\xmemory(34) :
error C2995: '_Construct' : template function has already been defined
c:\program files\microsoft visual
studio\vc98\include\stl\stl_construct.h(47) : see declaration of
'_Construct'
c:\program files\microsoft visual studio\vc98\include\xmemory(38) :
error C2995: '_Destroy' : template function has already been defined
c:\program files\microsoft visual
studio\vc98\include\stl\stl_construct.h(57) : see declaration of
'_Destroy'
c:\program files\microsoft visual studio\vc98\include\xutility(20) :
error C2995: 'copy' : template function has already been defined
c:\program files\microsoft visual
studio\vc98\include\stl\stl_algobase.h(267) : see declaration of 'copy'
c:\program files\microsoft visual studio\vc98\include\xutility(26) :
error C2995: 'copy_backward' : template function has already been
defined
c:\program files\microsoft visual
studio\vc98\include\stl\stl_algobase.h(390) : see declaration of
'copy_backward'
c:\program files\microsoft visual studio\vc98\include\xutility(30) :
error C2995: 'equal' : template function has already been defined
c:\program files\microsoft visual
studio\vc98\include\stl\stl_algobase.h(534) : see declaration of
'equal'
c:\program files\microsoft visual studio\vc98\include\xutility(34) :
error C2995: 'equal' : template function has already been defined
c:\program files\microsoft visual
studio\vc98\include\stl\stl_algobase.h(549) : see declaration of
'equal'
c:\program files\microsoft visual studio\vc98\include\xutility(39) :
error C2995: 'fill' : template function has already been defined
c:\program files\microsoft visual
studio\vc98\include\stl\stl_algobase.h(442) : see declaration of 'fill'
c:\program files\microsoft visual studio\vc98\include\xutility(54) :
error C2995: 'lexicographical_compare' : template function has already
been defined
c:\program files\microsoft visual
studio\vc98\include\stl\stl_algobase.h(564) : see declaration of
'lexicographical_compare'
c:\program files\microsoft visual studio\vc98\include\xutility(64) :
error C2995: 'lexicographical_compare' : template function has already
been defined
c:\program files\microsoft visual
studio\vc98\include\stl\stl_algobase.h(583) : see declaration of
'lexicographical_compare'
c:\program files\microsoft visual studio\vc98\include\xutility(90) :
error C2995: 'mismatch' : template function has already been defined
c:\program files\microsoft visual
studio\vc98\include\stl\stl_algobase.h(503) : see declaration of
'mismatch'
c:\program files\microsoft visual studio\vc98\include\xutility(96) :
error C2995: 'mismatch' : template function has already been defined
c:\program files\microsoft visual
studio\vc98\include\stl\stl_algobase.h(520) : see declaration of
'mismatch'
c:\program files\microsoft visual studio\vc98\include\xutility(101) :
error C2995: 'swap' : template function has already been defined
c:\program files\microsoft visual
studio\vc98\include\stl\stl_algobase.h(90) : see declaration of 'swap'
Error executing cl.exe.

ChatServer.obj - 28 error(s), 0 warning(s)
I am not able understand all these..

Please help me out...

Jun 10 '06 #9
* Prasad:

But , now I am getting a new list of errors...
c:\program files\microsoft visual studio\vc98\include\utility(27) :
error C2953: 'pair' : template class has already been defined


It seems you are mixing two different implementations of the standard
library.

Try to use just one of them.

For example the one bundled with your compiler.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jun 10 '06 #10

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

Similar topics

0
by: nmyatt | last post by:
Hi, The project I'm working on consists mainly of legacy VC6 C++ and VB, but we wish to write all new code in C#. So I'm looking at ways for exposing .NET functionality to VB and C++ through...
3
by: Lee Gillie | last post by:
I have a VS6 project which I brought into VS .NET, and all has been building fine. Then I upgraded to VS 2003 and I have one source which will no longer compile. Any clues? Compiling......
5
by: rodri rodri via DotNetMonster.com | last post by:
I have done a program with windows forms in "Visual C++". I have implemented a function that returns two values. For example: double functionExample(int parameter, double __gc* result2); And...
1
by: bor_kev | last post by:
Hi, i am developing under Microsoft Visual Studio 2005 (C++). I am using managed classes ( ref class Myclass) and STL.NET but i am facing two main problems : - As u know, now pointers are...
1
by: Simon Jefferies | last post by:
Hello, I'm writing a managed c++ project and have the following error:- error C2872: 'IServiceProvider' : ambiguous symbol could be 'c:\Program Files\Microsoft Visual Studio...
1
by: Rick | last post by:
Error 2 error C2872: 'IDataObject' : ambiguous symbol C:\Archivos de programa\Microsoft Visual Studio 8\VC\PlatformSDK\include\objidl.h 7408 this is the error i got by mix managed and unmanaged...
4
by: davidk13 | last post by:
My C++/CLI program uses the WinAPI to create a document, and my use of the Rectangle function--BOOL Rectangle (HDC hDC, int nLeft, int nTOP, int nRight, int nBottom--results in a compiler error...
6
by: phnimx | last post by:
I'm attempting to migrate a predominately MFC application that I've just inherited from Visual Studio.NET 2003 to Visual Studio 2005. I've managed to clean up a myriad of compile and link errors...
0
by: aWiproUser | last post by:
I am upgrading my project from VC 6 to VC++.NET i am getting c2872 error. Could help me regarding this.
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.