我尝试从Twinklebar SDL教程运行简单的test.cpp,出现此错误:
test.cpp:2:10: fatal error: 'SDL2/SDL.h' file not found
因此,我在Ubuntu / Mint中查找了sdl开发包:
aptitude search sdl | grep 2
我只能找到的是:
libsdl1.2-dev
这是否意味着我唯一的选择是从源代码安装?
这取决于您正在运行的Ubuntu版本,但是可以,对于Ubuntu,有一个libsdl2软件包:http ://packages.ubuntu.com/search?keywords=sdl2
所需的软件包称为libsdl2-dev
。
此外,关于这#include <SDL/SDL.h>
行,似乎推荐的方法是通过调整编译器标志来添加SDL的include pah和use #include "SDL.h"
。有关更多详细信息,请参见https://forums.libsdl.org/viewtopic.php?t=5997。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句