我尝试运行 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
这是否意味着我唯一的选择是从源代码安装?
我尝试运行 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
libsdl2-dev
。#include <SDL/SDL.h>
这一行,推荐的做法是通过调整编译器标志来添加SDL的include路径,并使用#include "SDL.h"
。请参考https://forums.libsdl.org/viewtopic.php?t=5997获取更多详细信息。<SDL.h>
。如果您使用正确的编译器标志,则不需要SDL2/
。 - HolyBlackCat