Haskell包矢量空间在编译时失败 [英] Haskell package vector-space fails at compile time
问题描述
我试图安装Haskell图库,并且其中一个依赖不能被安装。对于haskell没有那么经验,我不太清楚如何解决这个错误。
I tried to install the Haskell diagrams library and one of the dependencies cannot be installed. Being not that experienced to haskell, I cannot quite see how to resolve this error.
我删除了我认为与失败的构建(<$ c $)无关的警告c> ------ warnings ommitted(-Winvalid-pp-token)----- )
I removed warnings that I believe are not related to the failed build (------ warnings ommitted (-Winvalid-pp-token) -----
)
[hsenv]➜ ~HSENV cabal install vector-space-0.8.5
Resolving dependencies...
Downloading vector-space-0.8.5...
Configuring vector-space-0.8.5...
/var/folders/nq/fx4vf3v14jz9b8mldvcyv1xr0000gn/T/23218.c:1:12:
warning: control reaches end of non-void function [-Wreturn-type]
int foo() {}
^
1 warning generated.
Building vector-space-0.8.5...
Preprocessing library vector-space-0.8.5...
------ warnings ommitted (-Winvalid-pp-token) -----
src/Data/VectorSpace.hs:4:3:
error: invalid preprocessing directive
#-}
^
------ warnings ommitted (-Winvalid-pp-token) -----
2 warnings and 1 error generated.
Failed to install vector-space-0.8.5
cabal: Error: some packages failed to install:
vector-space-0.8.5 failed during the building phase. The exception was:
ExitFailure 1
推荐答案
我认为你在OS X与Xcode 5安装?有相关说明。
I presume you’re on OS X with Xcode 5 installed? There are instructions for that.
Xcode 5提供Clang作为C编译器,并且在预处理方面它与GCC之间存在一些解释差异。这些差异会影响一些使用 CPP
扩展名的Haskell代码。 Xcode 5用户的另一种方法是安装GCC并指定GHC。有关说明,请参见此页面。
Xcode 5 supplies Clang as the C compiler, and with respect to pre-processing there are some "differences of interpretation" between it and GCC. These differences can affect some Haskell code that uses the
CPP
extension. An alternate approach for users with Xcode 5 is to install a GCC and direct GHC at that. See this page for instructions.
这篇关于Haskell包矢量空间在编译时失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!