我试图安装gosu
Ryby gem
$ sudo gem install gosu
Building native extensions. This could take a while...
ERROR: Error installing gosu:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/gosu-0.13.3/ext/gosu
/usr/bin/ruby2.5 -r ./siteconf20180610-10446-laumk5.rb extconf.rb
The Gosu gem requires some libraries to be installed system-wide.
See the following site for a list:
https://github.com/gosu/gosu/wiki/Getting-Started-on-Linux
checking for TTF_RenderUTF8_Blended() in -lSDL2_ttf... yes
checking for SDL_ttf.h... yes
checking for -lopenal... no
creating Makefile
current directory: /var/lib/gems/2.5.0/gems/gosu-0.13.3/ext/gosu
make "DESTDIR=" clean
current directory: /var/lib/gems/2.5.0/gems/gosu-0.13.3/ext/gosu
make "DESTDIR="
compiling ../../src/Audio.cpp
In file included from ../../src/Audio.cpp:1:0:
../../src/AudioImpl.hpp:9:10: fatal error: AL/al.h: No such file or directory
#include <AL/al.h>
^~~~~~~~~
compilation terminated.
Makefile:234: recipe for target 'Audio.o' failed
make: *** [Audio.o] Error 1
make failed, exit code 2
Gem files will remain installed in /var/lib/gems/2.5.0/gems/gosu-0.13.3 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/gosu-
0.13.3/gem_make.out
shane@shane-HP-x2-Detachable-10-p0XX:~$ sudo apt-get install -lopenal
E: Command line option 'l' [from -lopenal] is not understood in combination
with the other options.
我注意到问题出在 -lopenal 上,但是如何安装或获取它才能正确下载
编辑: -lopenal 现在有一个是的感谢 N0rbert。但是现在我看到它在屏幕下方显示“致命错误”,那么我该如何解决这个问题?
您需要安装包含标头AL/al.h 的包 - 使用 packages.ubuntu.com和
sudo apt install libopenal-dev
.但是如果需要gosu Gem 编译成功,光靠安装
libopenal-dev
是不够的。您需要查阅官方文档来安装其他构建依赖项:
您可以通过运行以下命令来安装软件包
在 bash 命令中的参数前有一个连字符 (
-
) 被认为是在将选项传递给命令。你应该弄清楚某个头文件的包名是什么,然后用apt安装它。
你运行的命令
被解释为如下
一些提示
-dev
当您只需要头文件时,包名称会带有后缀。lib
.apt search <keyword>