0

Hello there, I'm trying to compile a project in Visual Studio 2005 and the compiler finds errors in the file fstream.h. Some of them are:

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

c:\program files\microsoft visual studio\vc98\include\fstream.h(89) : error C2872: 'streampos' : ambiguous symbol

c:\program files\microsoft visual studio\vc98\include\fstream.h(89) : error C2872: 'streamoff' : ambiguous symbol

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


First of all, do header files (the ones of the program) have mistakes, or did I something wrong?

What can I do to fix it?

4
Contributors
5
Replies
7
Views
8 Years
Discussion Span
Last Post by VernonDozier
Featured Replies
  • [QUOTE=floros;676516]Also there are 2 more errors for these: //set up an input stream ifstream input; input.open (imagefile, ifstream::in); error C2872: 'ifstream' : ambiguous symbol //open the output file ofstream output; output.open (outputfile, ofstream::out); 'ofstream' : ambiguous symbol[/QUOTE] Why don't you just use [ICODE]fstream[/ICODE] rather than [ICODE]fstream.h[/ICODE] , even if VS … Read More

0

What else is in your code?
Did you define those symbols yourself?

Post a minimal complete program which demonstrates the problem.

0

fstream.h in Visual Studio 2005? Impossible! Your program gets old stream library includes (with .h names) in old Visual Studio include directory. Check up your installation environment. May be, you try to compile old (legacy) project.

0

I searched at the include folder and I saw that there is the fstream.h file.
I use the #include <fstream.h> header

Maybe I try to compile in an old type compiler (I don't know)

0

Also there are 2 more errors for these:

//set up an input stream
ifstream input;
input.open (imagefile, ifstream::in);

error C2872: 'ifstream' : ambiguous symbol


//open the output file
ofstream output;
output.open (outputfile, ofstream::out);

'ofstream' : ambiguous symbol

1

Also there are 2 more errors for these:

//set up an input stream
ifstream input;
input.open (imagefile, ifstream::in);

error C2872: 'ifstream' : ambiguous symbol


//open the output file
ofstream output;
output.open (outputfile, ofstream::out);

'ofstream' : ambiguous symbol

Why don't you just use fstream rather than fstream.h , even if VS 2005 lets you use fstream.h ? I know next to nothing about fstream.h except that my compiler never misses an opportunity to warn me not to use it. Changing to an old compiler so you can compile code with deprecated headers instead of trying to change to a new header seems like the wrong strategy to me.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.