Error: The name streambuf is ambiguous, streambuf and std::streambuf.

Hi i m trying to write huge code buts it getting error,
"/opt/studio11/SUNWspro/prod/include/CCios/iostream.h", line 1387: Error: The name streambuf is ambiguous, streambuf and std::streambuf.
Can anyone explain me whats the reason to get this error and probable solution?????
closed account (z05DSL3A)
The compiler has come across the name streambuf and has found more than one definition for it, streambuf and std::streambuf.

This could be due to including a header that should not be included or careless use of something like using namespace std;


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include<iostream>

int test;          // test 1

namespace GW
{
    int test;      // test 2
}

using namespace GW;

int main()
{
    test = 0;      // error C2872: 'test' : ambiguous symbol
    ::test = 0;    // use test 1
    GW::test = 0;  // use test 2
}
Last edited on
Topic archived. No new replies allowed.