Link to home
Start Free TrialLog in
Avatar of PMH4514
PMH4514

asked on

C++, Enum, missing type specifier, int assumed.

Hi, in a VC++ 6.0 project, I had the following, which compiled and worked as desired:

enum CameraStatus
{
      CAMERA_STOPPED = 0,
      CAMERA_PREVIEW ,
      CAMERA_PAUSED ,
      CAMERA_CAPTURE_REQUESTED
};

..

virtual SetStatus(CameraStatus a_Status){ m_Status = a_Status;};
..

CameraStatus m_Status;

---------
But in Visual Studio 2010, I now get an error:
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int


How do I explicitly apply the int type to my enumeration?

Thanks
SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PMH4514
PMH4514

ASKER

I had tried that actually. I still get the error:

 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

on this line:

virtual SetStatus(CameraStatus a_Status){ m_Status = a_Status;};
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PMH4514

ASKER

what's interesting is that I have other similar constructs in the code and the compiler isn't complaining.
Yes, it's only the missing return type, VC++ 6 was a lot more forgiving about things like that ;o)
Avatar of PMH4514

ASKER

ahh yes, jkr, you are correct sir.  thank you!

I guess I did specifically ask "How do I explicitly apply the int type to my enumeration?" and  #ged325 did specifically answer that, despite my real question being the compile error.

so I'll bump points and award you both.