2

在 Windows 中尝试从 cabal 安装snap时,它抱怨无法找到 C 编译器。

这是输出:

> cabal update
> cabal install snap
Resolving dependencies...
In order, the following will be installed:
directory-1.2.0.0 (new version)
clientsession-0.8.0.1 (new package)
directory-tree-0.10.1 (new version)
process-1.1.0.2 (new version)
heist-0.8.1.1 (reinstall) changes: directory-1.1.0.2 -> 1.2.0.0,
directory-tree-0.11.0 -> 0.10.1, process-1.1.0.1 -> 1.1.0.2
unix-compat-0.4.0.0 (new package)
configurator-0.2.0.1 (new package)
snap-core-0.9.2.1 (new package)
snap-server-0.9.2.3 (new package)
snap-0.9.2.1 (new package)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Configuring directory-1.2.0.0...
configure: WARNING: unrecognized options: --with-compiler, --with-gcc
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/tmp/directory-1.2.0.0-4480/directory-1.2.0.0':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
cabal.exe: Error: some packages failed to install:
clientsession-0.8.0.1 depends on directory-1.2.0.0 which failed to install.
configurator-0.2.0.1 depends on directory-1.2.0.0 which failed to install.
directory-1.2.0.0 failed during the configure step. The exception was:
ExitFailure 1
directory-tree-0.10.1 depends on directory-1.2.0.0 which failed to install.
heist-0.8.1.1 depends on directory-1.2.0.0 which failed to install.
process-1.1.0.2 depends on directory-1.2.0.0 which failed to install.
snap-0.9.2.1 depends on directory-1.2.0.0 which failed to install.
snap-core-0.9.2.1 depends on directory-1.2.0.0 which failed to install.
snap-server-0.9.2.3 depends on directory-1.2.0.0 which failed to install.
unix-compat-0.4.0.0 depends on directory-1.2.0.0 which failed to install.

如果它是用 Haskell 编写的,为什么还需要 C 编译器?

4

1 回答 1

4

它需要一个 C 编译器,因为目录包有用 C 编写的位(通过 FFI 访问),正如您可以从cabal 文件的 c-sources 部分看到的那样。

于 2012-10-01T03:09:51.077 回答