locked
see reference to class template instantiation 'std::_Locbase<_Dummy>' being compiled RRS feed

  • Question

  • Has anyone seen this error?

     

    I'm moving my VC++ project to build on Visual Studio 2005 standard edition.

    The old source code

    is

    #include <strstrea.h> // this causes and error "cannot open file "strstrea.h"

    ostrstream os;

    Then I got an error told me to use #include <strstream> instead.

    After I change from using strstrea.h to strstream, a lot of errors messages happened.

    demo2.cpp

    c:\program files\microsoft visual studio 8\vc\include\xlocinfo(125) : error C3861: 'localeconv': identifier not found

    c:\program files\microsoft visual studio 8\vc\include\xlocale(26) : error C2065: 'LC_COLLATE' : undeclared identifier

    c:\program files\microsoft visual studio 8\vc\include\xlocale(63) : see reference to class template instantiation 'std::_Locbase<_Dummy>' being compiled

    with

    [

    _Dummy=int

    ]

    c:\program files\microsoft visual studio 8\vc\include\xlocale(26) : error C2057: expected constant expression

    c:\program files\microsoft visual studio 8\vc\include\xlocale(27) : error C2065: 'LC_CTYPE' : undeclared identifier

    c:\program files\microsoft visual studio 8\vc\include\xlocale(27) : error C2057: expected constant expression

    c:\program files\microsoft visual studio 8\vc\include\xlocale(28) : error C2065: 'LC_MONETARY' : undeclared identifier

    c:\program files\microsoft visual studio 8\vc\include\xlocale(28) : error C2057: expected constant expression

    c:\program files\microsoft visual studio 8\vc\include\xlocale(29) : error C2065: 'LC_NUMERIC' : undeclared identifier

    c:\program files\microsoft visual studio 8\vc\include\xlocale(29) : error C2057: expected constant expression

    c:\program files\microsoft visual studio 8\vc\include\xlocale(30) : error C2065: 'LC_TIME' : undeclared identifier

    c:\program files\microsoft visual studio 8\vc\include\xlocale(30) : error C2057: expected constant expression

    c:\workingfile\testcode\gloviaclient_vc8\c\demo2.cpp(242) : error C2065: 'ostrstream' : undeclared identifier

    c:\workingfile\testcode\gloviaclient_vc8\c\demo2.cpp(242) : error C2146: syntax error : missing ';' before identifier 'os'

    c:\workingfile\testcode\gloviaclient_vc8\c\demo2.cpp(242) : error C2065: 'os' : undeclared identifier

    c:\workingfile\testcode\gloviaclient_vc8\c\demo2.cpp(243) : error C2065: 'endl' : undeclared identifier

    c:\workingfile\testcode\gloviaclient_vc8\c\demo2.cpp(245) : error C2065: 'ends' : undeclared identifier

    c:\workingfile\testcode\gloviaclient_vc8\c\demo2.cpp(246) : error C2228: left of '.str' must have class/struct/union

    type is ''unknown-type''

    c:\workingfile\testcode\gloviaclient_vc8\c\demo2.cpp(250) : error C2228: left of '.rdbuf' must have class/struct/union

    type is ''unknown-type''

    c:\workingfile\testcode\gloviaclient_vc8\c\demo2.cpp(250) : error C2227: left of '->freeze' must point to class/struct/union/generic type

     

    Thursday, October 5, 2006 2:54 AM

Answers

  • You may need to incclude locale ( #include <locale> )

    When you have written #include<strstrea.h> the compilation end up in a single error because AFAIK Visual C++ Stops compiling that file on seeing error in the header file inclusion section. That's why the other errors not shown there.

    Thursday, October 5, 2006 4:19 AM
  • I just found that in have the source code file names locale.h and locale.cpp in my project which might cause a confliction of header file.

    I change the file name and it now solves the problem.

    Thank you.

    Thursday, October 5, 2006 4:23 AM

All replies

  • You may need to incclude locale ( #include <locale> )

    When you have written #include<strstrea.h> the compilation end up in a single error because AFAIK Visual C++ Stops compiling that file on seeing error in the header file inclusion section. That's why the other errors not shown there.

    Thursday, October 5, 2006 4:19 AM
  • I just found that in have the source code file names locale.h and locale.cpp in my project which might cause a confliction of header file.

    I change the file name and it now solves the problem.

    Thank you.

    Thursday, October 5, 2006 4:23 AM