This question already has an answer here:
“C4430: missing type specifier - int assumed” in a template function
(1个答案)
7年前关闭。
下面的代码在VC++ 6.0中完美编译,但是当我在VS2005中打开项目时,出现此错误:
可能是什么问题呢 ?
没有返回值,您应该这样做:
(1个答案)
7年前关闭。
下面的代码在VC++ 6.0中完美编译,但是当我在VS2005中打开项目时,出现此错误:
可能是什么问题呢 ?
class BCGCONTROLBARDLLEXPORT CBCGPopupMenu : public CMiniFrameWnd
{
public:
enum ANIMATION_TYPE
{
NO_ANIMATION,
UNFOLD,
SLIDE,
FADE
};
static SetAnimationType (CBCGPopupMenu::ANIMATION_TYPE type)
{
m_AnimationType = type; // this line gives error
}
protected:
static ANIMATION_TYPE m_AnimationType;
};
最佳答案
static SetAnimationType (CBCGPopupMenu::ANIMATION_TYPE type)
没有返回值,您应该这样做:
static void SetAnimationType (CBCGPopupMenu::ANIMATION_TYPE type)