我正在尝试使用 "cabal install sdl-mixer" 命令安装 SDL-mixer Haskell 包。但是,安装过程中出现了错误。
Resolving dependencies...
[1 of 1] Compiling Main ( /tmp/SDL-mixer-0.6.1-10381/SDL-mixer-0.6.1/Setup.lhs, /tmp/SDL-mixer-0.6.1-10381/SDL-mixer-0.6.1/dist/setup/Main.o )
Linking /tmp/SDL-mixer-0.6.1-10381/SDL-mixer-0.6.1/dist/setup/setup ...
Configuring SDL-mixer-0.6.1...
configure: WARNING: unrecognized options: --with-compiler, --with-gcc
checking for sdl-config... /usr/bin/sdl-config
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/tmp/SDL-mixer-0.6.1-10381/SDL-mixer-0.6.1':
configure: error: C compiler cannot create executables
See `config.log' for more details.
Failed to install SDL-mixer-0.6.1
cabal: Error: some packages failed to install:
SDL-mixer-0.6.1 failed during the configure step. The exception was:
ExitFailure 77
如果有区别的话,我使用的是Arch Linux。我该如何安装这个软件包?
configure
脚本,它无法识别--with-gcc
选项。C编译器(gcc)似乎对configure
脚本不起作用。在cabal install
之前,您可以尝试设置CC
环境变量,例如$ export CC="/path/to/your/gcc"
,但如果--with-gcc
选项不是由您手动添加而是由cabal
自动添加的,那么这种方法可能不起作用。您可以使用cabal unpack SDL-mixer
,并在其目录中运行cabal install -v2
(或者也许需要-v3
)以获取configure
所使用的命令行。然后自己运行它并查看config.log
。 - Daniel Fischer