Author Topic: error compiling under MSVC 7.1  (Read 16126 times)


  • User
  • *
  • Posts: 2
error compiling under MSVC 7.1
« on: April 05, 2005, 05:43:23 AM »

I have a strange error compiling under MSVC 7.1:
c:\gne\include\gnelib\ConsoleStreambuf.h(77) : error C2653: 'char_traits<char>' : is not a class or namespace name
I tried a little bit around but could not detect the origin of that error.

I have just downloaded the following files:

Thank you for any hints!



  • User
  • *
  • Posts: 2
« Reply #1 on: April 07, 2005, 05:04:10 AM »
the std seems to have a slight different interface


  • Administrator
  • User
  • *****
  • Posts: 147
error compiling under MSVC 7.1
« Reply #2 on: April 07, 2005, 02:37:02 PM »
This was mentioned in a news post on the GNE SF project page, and has been fixed in the CVS:

There is a bug in the MSVC.NET 2003 compiler/standard C++ library that causes ConsoleStreambuf.h not to compile. This is a bug that has been verified by Microsoft, and is currently fixed, so the next version will not have this problem. This error does not occur in MSVC.NET 2002.
You can workaround the bug by modifying the code. You can see the workaround in CVS here:

Here is the new code to be placed in the ConsoleStreambuf.h header:
Code: [Select]
#if (_MSC_VER == 1310 )
  //While still technically correct and valid, it's not quite as robust as the
  //next line because this makes the assumption on what traits_type is defined
  int_type overflow(int_type meta = std::char_traits<char>::eof());
  //For some reason, in MSVC.NET 2003 alone (not 2002), this line generates
  //the following error:
  //error C2653: 'char_traits<char>' : is not a class or namespace name
  int_type overflow(int_type meta = traits_type::eof());
Gillius's Programming


  • User
  • *
  • Posts: 1
Re: error compiling under MSVC 7.1
« Reply #3 on: October 10, 2009, 03:02:13 AM »
Oh,I got it!
I thought i got the wrong version with boost or something, and wasted lots of time.