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

alex001

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

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:
gnelib-0_70_docs.zip
gnelib-0_70.zip
gnelib-0_70_docs_guidepatch.zip
gnelib-min-boost_1_30_0.zip
Hawk_bin.zip

Thank you for any hints!

Regards,
Alex

alex001

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

Gillius

  • Administrator
  • User
  • *****
  • Posts: 147
    • http://www.gillius.org/
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:

Quote
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:
http://cvs.sourceforge.net/viewcvs.py/gnelib/gnelib/include/gnelib/ConsoleStreambuf.h?rev=1.9&view=markup

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
  //as.
  int_type overflow(int_type meta = std::char_traits<char>::eof());
#else
  //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());
#endif
Gillius
Gillius's Programming http://www.gillius.org/

Tiger

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