I am porting a solution from Visual C++ 8 (visual studio 2005) to 10 (visual studio 2010), and I am getting a puzzling error for which I have found only sparse links on the web (for example this which refers to visual studio 2005, but there is no follow up so he must have fixed in some way).
The error is the following. In files which include the fstream header I get
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\fstream(111): error C2766: explicit specialization; 'bool std::_Ungetc<char>(const char &,_iobuf *)' has already been defined
1> C:\Program Files\Microsoft Visual Studio 10.0\VC\include\fstream(103) : see previous definition of '_Ungetc'
At first I supposed that there was some remaining reference to VC 8, so I started from scratch adding existing files to a new solution / project but I am getting the same error. Commenting out the include (and the relevant functionality) the project compiles and links.
This must be some kind of misconfiguration on my parts, since a minimal program like this
#include <fstream>
int main(){
std::fstream stream;
return 0;
}
is compiled without errors, so the header didn't get somehow corrupt after installation.
I am unfortunately unable to reproduce a minimal working example, but I hope that something of this problem could ring a bell to someone. Do you have some suggestions of things that I could check?