在dev c++中使用SDL时未终止的#ifndef

Unterminted #ifndef while using SDL in dev c++

本文关键字:终止 #ifndef SDL dev c++      更新时间:2023-10-16

我目前有问题纠正这个错误在我的开发c++项目,这是我的代码:

#ifndef GRAPHICS_H
#define GRAPHICS_H
struct SDL_Window;
struct SDL_Renderer;
class Graphics {
public:
    Graphics();
    ~Graphics();
private:
    SDL_Window* _window;
    SDL_Renderer* _renderer;
};

但是编译器说"未终止#ifndef"和预期的初始化器之前的'~'标记,我已经试图解决这个问题超过3小时,但仍然无法解决这个

#ifndef GRAPHICS_H
#define GRAPHICS_H

#ifndef语句需要用#endif关闭。您可能应该将它添加到文件的末尾,以便将其中的所有内容保留在GRAPHICS_H的范围内。