SDL/SDL.h:没有这样的文件或目录
SDL/SDL.h: No such file or directory
我正在按照教程在 Eclipse 中设置 SDL。
我必须下载 7zip 才能打开 tar 文件。 我根据教程使用 7 zip 复制所有文件。 我尝试将SDL.dll
的副本放入C:WINDOWSSYSTEM32
中,并将项目文件夹放在我的 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 <SDL/SDL.h>
但这也没有成功。
您是否忘记执行教程中的步骤 3?
从链接的教程:
- 之后,打开存档中的包含子文件夹,并将名为"SDL"的文件夹解压缩到 MinGW 包含文件夹,该文件夹应位于 C:\MinGW\include。
这些编译错误是由于编译器无法找到包含在main.cpp
中的 SDL 头文件造成的。
发生这种情况是因为您没有告诉编译器在哪里可以找到 SDL 标头。尝试将-I"path_to_your_SDL_include_directory"
传递给编译器。
相关文章:
- 使用 C++ 或 SDL 在 Android 中创建文件
- 正确地在多文件项目中#CRUDING SDL
- Eclipse SDL.h 没有这样的文件或目录,所有内容都正确链接
- 音频编程 SDL - 如何使用 wav 文件在命令行中指定频率切割
- 是否可以将 SDL .lib、.dll 和头文件放在某个地方,以便我可以在 Visual Studio 2017 RC 项目中键入 #include < SDL2.h>?
- 使用SDL库的可执行文件的奇怪行为
- SDL/SDL.h:没有这样的文件或目录
- 包含语句:找不到 SDL/SDL.h 文件
- 在生成文件、c++ 中链接 SDL 库
- SDL MinGW Netbeans。<SDL/SDL.h> 没有这样的文件或目录
- SDL在程序可执行文件中嵌入图像
- SDL从文件加载图像
- 我如何获得win32文件浏览器与SDL
- 在SDL中创建一个新文件夹或目录
- Xcode SDL资源文件夹
- SDL无法使用文件和标头加载媒体
- 无法用多文件程序创建SDL线程
- QT SDL无法识别(有Qmake文件列出.我做错了吗?)
- SDL/SDL_image.h:没有这样的文件或目录
- C++SDL代码::块:在头文件中声明指向全局可验证性的指针,同时避免多个包含问题