c++ - SDL/SDL.h : No such file or directory

标签 c++ eclipse sdl

我正在关注 a tutorial在 Eclipse 中设置 SDL。

我必须下载 7zip 才能打开 tar 文件。我根据教程使用 7 zip 复制了所有文件。我尝试将 SDL.dll 的拷贝放入 C:\WINDOWS\SYSTEM32 以及我的 eclipse 工作区中的项目文件夹。

当我尝试运行以下代码时:

#include "SDL/SDL.h"

int main( int argc, char* args[] )
{
    //Start SDL
    SDL_Init( SDL_INIT_EVERYTHING );

    //Quit SDL
    SDL_Quit();

    return 0;
}

我得到以下编译错误:

..\main.cpp:1:21: SDL/SDL.h: No such file or directory
..\main.cpp: In function `int main(int, char**)':
..\main.cpp:6: error: `SDL_INIT_EVERYTHING' undeclared (first use this function)
..\main.cpp:6: error: (Each undeclared identifier is reported only once for each function it appears in.)
..\main.cpp:6: error: `SDL_Init' undeclared (first use this function)
..\main.cpp:9: error: `SDL_Quit' undeclared (first use this function)

我尝试用以下内容替换 include 语句:

#include <SDL/SDL.h> 

但这也没有成功。

最佳答案

您是否忘记了教程中的第 3 步?

来自链接教程:

  1. After that, open the include subfolder in the archive and extract the folder named "SDL" to the MinGW include folder, which should be at C:\MinGW\include.

关于c++ - SDL/SDL.h : No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13408410/

相关文章:

Mac OS X 上的 Eclipse : Shortcuts are broken

java - Android 在点击发送按钮后停止工作

c++ - SDL2 无法正确链接

c++ - 无法从文件读取整数到矩阵

java - Eclipse Glassfish 4.0 无法按时启动服务器

c++ - 使用 C++ 编写了一个 SDL 游戏并想要部署它

c - 使用 SDL2、openGL ES 2.0 (GLSL 1.0) 和 Freetype 渲染字体

C++:作为条件语句的逻辑比较?

c++ - fwrite 是否缓冲输出?

c++ - 删除指针数组中的元素(调整大小)