我试图从Twinklebar SDL教程运行简单的test.cpp,我得到这个错误:
test.cpp:2:10: fatal error: 'SDL2/SDL.h' file not found
所以我在Ubuntu / Mint中查找sdl开发包:
aptitude search sdl | grep 2
我能find的是这样的:
libsdl1.2-dev
这是否意味着我唯一的select是从源代码安装?
这取决于你正在运行的Ubuntu版本,但是,有一个Ubuntu的libsdl2软件包: http ://packages.ubuntu.com/search?keywords=sdl2
你想要的软件包叫做libsdl2-dev
。
另外,关于#include <SDL/SDL.h>
行,似乎是通过调整编译器标记来添加SDL的include pah并使用#include "SDL.h"
。 有关更多详细信息,请参阅https://forums.libsdl.org/viewtopic.php?t=5997 。