如何在 Ubuntu 14.04 中安装所有 SDL 库?

如何在 Ubuntu 14.04 中安装所有 SDL 库?
dpkg -l | grep sdl

该命令提供以下详细信息:

ii  libsdl1.2debian:i386                                        1.2.15-8ubuntu1.1                                   i386         Simple DirectMedia Layer

我不知道我的系统上是否安装了 SDL 1.2?另外,我是否需要安装 sdl image、mixer、ttf 等等?如何安装它们?

答案1

安装方法:

sudo apt-get install libsdl2-2.0

并安装构建使用 SDL 的程序所需的一切:

sudo apt-get install libsdl2-dev

答案2

libsld1.2您可以使用以下命令搜索所有可用的实例:

andrew@corinth:~$ apt-cache search ^libsdl | grep 1.2
libsdl1.2-dbg - Simple DirectMedia Layer debug files
libsdl1.2-dev - Simple DirectMedia Layer development files
libsdl1.2debian - Simple DirectMedia Layer
libsdl-image1.2-dbg - Image loading library for Simple DirectMedia Layer 1.2, debugging
libsdl-mixer1.2-dbg - Mixer library for Simple DirectMedia Layer 1.2, debugging
libsdl-net1.2-dbg - Network library for Simple DirectMedia Layer 1.2, debugging
libsdl-gfx1.2-4 - drawing and graphical effects extension for SDL
libsdl-gfx1.2-dev - development files for SDL_gfx
libsdl-gfx1.2-doc - documentation files for SDL_gfx
libsdl-image1.2 - Image loading library for Simple DirectMedia Layer 1.2, libraries
libsdl-image1.2-dev - Image loading library for Simple DirectMedia Layer 1.2, development files
libsdl-mixer1.2 - Mixer library for Simple DirectMedia Layer 1.2, libraries
libsdl-mixer1.2-dev - Mixer library for Simple DirectMedia Layer 1.2, development files
libsdl-net1.2 - Network library for Simple DirectMedia Layer 1.2, libraries
libsdl-net1.2-dev - Network library for Simple DirectMedia Layer 1.2, development files
libsdl-sound1.2 - Sound library for Simple DirectMedia Layer 1.2, libraries
libsdl-sound1.2-dev - Sound library for Simple DirectMedia Layer 1.2, development files
libsdl-ttf2.0-0 - TrueType Font library for Simple DirectMedia Layer 1.2, libraries
libsdl-ttf2.0-dev - TrueType Font library for Simple DirectMedia Layer 1.2, development files
andrew@corinth:~$ 

然后简单地安装所有生成的文件,如下所示:

sudo apt-get install libsdl1.2debian libsdl-gfx1.2-5 \
libsdl-gfx1.2-dev libsdl-gfx1.2-doc libsdl-image1.2 \
libsdl-image1.2-dbg libsdl-image1.2-dev libsdl-mixer1.2 \
libsdl-mixer1.2-dbg libsdl-mixer1.2-dev libsdl-net1.2 \
libsdl-net1.2-dbg libsdl-net1.2-dev libsdl-sound1.2 \
libsdl-sound1.2-dev libsdl-ttf2.0-0 libsdl-ttf2.0-dev

您可以轻松省去一些文件,例如那些.dbg只是调试附加文件的文件,除非您正在编译,否则您将不需要这些-dev文件。有些文件也是其他文件的依赖项,并且会在安装其中一个文件时自动安装...

答案3

你可以这样做:

sudo apt-get install libsdl1.2-dbg

或者下载SDL源码进行编译安装:

下载 SDL

tar xvf SDL-1.2.tar.gz
cd SDL-1.2
./configure
make
sudo make install

答案4

如果 Shahin Bakhshaei 的回答(日期时间戳:2017-04-28T08:43)还未解决您的问题,请使用以下终端命令进行验证:

sudo apt-get install aptitude
sudo aptitude install libsdl2-dev

提醒:我们libsdl2-dev在构建使用 SDL 的软件应用程序时使用。这不仅仅是执行应用程序。

谢谢。

相关内容