Topic
  • 4 replies
  • Latest Post - ‏2012-09-28T16:05:50Z by Yevo
CodeDeveloper
CodeDeveloper
5 Posts

Pinned topic error C2653: 'std' : is not a class or namespace name.

‏2012-09-27T05:19:48Z |
Hello ,

I am using Rhapsody 7.6.

When I generate code for my project it is generating header file for vector also.Its size is 0KB(Please refer attachment)

I have following declaration in my model
typedef std::vector<U8> ByteArray;

It is giving error as follows for above declaration.
error C2653: 'std' : is not a class or namespace name.

Please provide solution for the same.
Updated on 2012-09-28T16:05:50Z at 2012-09-28T16:05:50Z by Yevo
  • shanz9903
    shanz9903
    273 Posts

    Re: error C2653: 'std' : is not a class or namespace name.

    ‏2012-09-27T09:15:36Z  
    I believe you are probably using Microsoft (Visual Studio 6) for your configuration's environment.
    Somehow it means that std:: is already 'used' so you shouldn't add it explicitly.
    If you change it to msvc9 (Visual Studio 2008) then std:: is needed as expected.
  • shanz9903
    shanz9903
    273 Posts

    Re: error C2653: 'std' : is not a class or namespace name.

    ‏2012-09-27T09:46:00Z  
    • shanz9903
    • ‏2012-09-27T09:15:36Z
    I believe you are probably using Microsoft (Visual Studio 6) for your configuration's environment.
    Somehow it means that std:: is already 'used' so you shouldn't add it explicitly.
    If you change it to msvc9 (Visual Studio 2008) then std:: is needed as expected.
    #if (_MSC_VER == 1200)
    cout << "Hello vs c++ 6 World" << endl;
    #else
    std::cout << "Hello vs 2008 World" << std::endl;
    #endif
  • shanz9903
    shanz9903
    273 Posts

    Re: error C2653: 'std' : is not a class or namespace name.

    ‏2012-09-27T12:03:08Z  
    Interestingly it looks like Rhapsody 8.0 has dropped support for Microsoft (VC6) completely.
    The default environment is now MSVC and you can change a property CPP_CG::MSVC::IDEVersion to either "VC9" (VS2008) or "VC10" (VS2010).
  • Yevo
    Yevo
    280 Posts

    Re: error C2653: 'std' : is not a class or namespace name.

    ‏2012-09-28T16:05:50Z  
    • shanz9903
    • ‏2012-09-27T12:03:08Z
    Interestingly it looks like Rhapsody 8.0 has dropped support for Microsoft (VC6) completely.
    The default environment is now MSVC and you can change a property CPP_CG::MSVC::IDEVersion to either "VC9" (VS2008) or "VC10" (VS2010).
    You are correct:Rhp8.0 doesn't support VS6 out-of-the-box. Moreover, if existing model contains MSVC9 environment configuration it will be automatically replaced with MSVC environment setting (including all overridden MSVC9 properties).