如何在Mac OS上安装Haskell [英] How to install Haskell on Mac OS
本文介绍了如何在Mac OS上安装Haskell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我做了什么:
$ brew install ghc
好的。现在我试图安装
$ cabal install text
并获取下一条错误消息:
Data / Text.hs:1074 :4:
错误:无效预处理指令
# - }
^
我搜索了Google,发现这个。
所以:
-
brew install gcc48
$ /usr/local/bin/gcc-4.8 --version
gcc-4.8(GCC)4.8.2
版权所有(C)2013 Free Software Foundation,Inc.
这是免费软件;请参阅复制条件的来源。没有任何b $ b保修;甚至不适用于适销性或针对特定用途的适用性。
$ cat /usr/local/lib/ghc-7.6.3/settings
[(GCC extra via C opts,-fwrapv),
( C编译器命令,/usr/local/bin/gcc-4.8),
(C编译器标志,-m64 -fno-stack-protector -m64),
.. 。
-
brew install cabal-install
- cabal安装文本
我收到相同的消息。
如何修复它们?
尝试使用< a href =http://www.haskell.org/platform/mac.html =noreferrer> Mac版的Haskell平台,我没有Mac来试用它,但我的希望 cabal
可以在Haskell Platform中直接使用。 I am trying to install Haskell on my Macbook two days and can not get the success.
What I have done:
$ brew install ghc
Fine. Now I am trying to install
$ cabal install text
and get next error messages:
Data/Text.hs:1074:4:
error: invalid preprocessing directive
#-}
^
I have googled and found this.
So:
brew install gcc48
$ /usr/local/bin/gcc-4.8 --version gcc-4.8 (GCC) 4.8.2 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ cat /usr/local/lib/ghc-7.6.3/settings [("GCC extra via C opts", " -fwrapv"), ("C compiler command", "/usr/local/bin/gcc-4.8"), ("C compiler flags", " -m64 -fno-stack-protector -m64"), ...
brew install cabal-install
- cabal install text
And I get the same messages.
How can I fix them ?
解决方案
Try using the Mac version of the Haskell Platform, I don't have a Mac to try it out but my hope is that cabal
will work out-of-the-box in the Haskell Platform.
这篇关于如何在Mac OS上安装Haskell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文