VC++ missing type specifier - int assumed. Note: C

2019-07-09 04:23发布

This question already has an answer here:

Following code compiled perfectly fine in VC++ 6.0, but when I opened the project in VS2005, I get this error:

BCGPopupMenu.h(100): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

What could be the problem ?

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;

};

2条回答
趁早两清
2楼-- · 2019-07-09 04:48
static SetAnimationType (CBCGPopupMenu::ANIMATION_TYPE type)

there is no return value,you should do:

static void SetAnimationType (CBCGPopupMenu::ANIMATION_TYPE type)
查看更多
做个烂人
3楼-- · 2019-07-09 04:58

One possible reason is missing definitions. When you switch IDE, make sure you add every path you need into project setting.

See Tools >> Options >> Projects and Solutions >> VC++ Directories

查看更多
登录 后发表回答