语法错误:所有指针在'*'之前缺少';'?

syntax error : missing ';' before '*' for all pointers?

本文关键字:错误 指针 语法      更新时间:2023-10-16

由于某些原因,当我编译我的代码:

class MainClass
{
public:   
    MainClass(void);
    bool init();
    bool loadMedia();
    SDL_Surface* loadSurface( std::string path );
    void gameLoop();
    ~MainClass(void);
private:
    SDL_Window* gWindow;
    SDL_Surface* gScreenSurface;
    SDL_Surface* gPNGSurface;
    SDL_Surface* gPNGSurface;
    static const int SCREEN_WIDTH = 640;
    static const int SCREEN_HEIGHT = 480;
};

编译器为我拥有的每个指针给出这个错误。任何建议吗?

error C2143: syntax error : missing ';' before '*' 
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

我猜你不包括SDL_Window和SDL_Surface的头文件(我认为它是SDL.h)