1

如果我启动一个新项目,添加hfsevents.cabal文件中的依赖项列表,然后运行stack build,我会收到一个错误(在 Mac OSX Yosemite 上):

--  While building package hfsevents-0.1.6 using:
/Users/Me/.stack/setup-exe-cache/setup-Simple-Cabal-1.22.4.0-x86_64-osx-ghc-7.10.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/ build --ghc-options -hpcdir .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/hpc/.hpc/ -ddump-hi -ddump-to-file
Process exited with code: ExitFailure 1
Logs have been written to: /Users/Me/Desktop/code/haskell/test/.stack-work/logs/hfsevents-0.1.6.log

Configuring hfsevents-0.1.6...
Building hfsevents-0.1.6...
Preprocessing library hfsevents-0.1.6...
[1 of 1] Compiling System.OSX.FSEvents ( System/OSX/FSEvents.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/System/OSX/FSEvents.o )
gcc: error: language objective-c not recognized
gcc: error: language objective-c not recognized

我已经按照调用的建议brew install gcc48 --with-all-languages卸载了所有 Haskell 版本,只使用了ghcinside stack。Xcode 版本为 7.1.1。我还能尝试什么来解决这个问题?

4

1 回答 1

3

最终得到了这个工作。导致我找到解决方案的步骤记录在这里:https ://github.com/commercialhaskell/stack/issues/1563

基本上,我安装了两种不同gcc的 ',一种/usr/bin/由 Xcode 安装,另一种/usr/local/bin/来自我不记得的地方。/usr/bin/gcc是 被 使用的那个cabal,所以cabal install hfsevents有效,而/usr/local/bin/gcc,显然是 被 使用的那个stack,有这个问题。我为解决这个问题所做的是删除/usr/local/bin/gcc并且只保留/usr/bin/gcc.

于 2016-01-06T20:10:53.967 回答