Facing problem with Enum while mirgating from Vc 6.0 to Vc 8.0

Cpp , VC 6.0 , Vc 8.0 Delhi, India
  • 8 years ago

    Hi Experts

    I am migrating one project from Vc 6.0 to Vc 8.0. I found one compilation Error regarding Enum.

    In Vc 6.0 they have declared an enum in a class and again the same enum they are using in other class with scope resolution and have changed the enum value. It is compiling fine on Vc 6.0 but throwing an error while compiling in Vc 8.0.

    Example code.

    class CTest { public: enum TestEnum {NA=0, First}; };

    class CTest1 { public: enum CTest::TestEnum {Second, Third};

    };

    It is working fine in Vc 6.0 but throwing error in Vc 8.0 Error is:- error C2911: 'CTest::TestEnum' : cannot be declared or defined in the current scope

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Weeks of coding can save you hours of planning.”