我正在关注 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 步?
来自链接教程:
- 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/