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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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)
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.
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.
ASKER
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;};