Objective-C无法识别使用堆栈构建hfsevents

时间:2015-12-24 03:05:53

标签: haskell haskell-stack

如果我启动一个新项目,将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的建议,并且我只使用ghc中的stack卸载了所有Haskell版本。 Xcode版本为7.1.1。我还能尝试解决这个问题吗?

1 个答案:

答案 0 :(得分:3)

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

基本上,我安装了两个不同的gcc,其中一个安装在/usr/bin/中,由Xcode安装,另一个安装在/usr/local/bin/中,我不记得了。 /usr/bin/gcc使用的是cabalcabal install hfsevents正在使用/usr/local/bin/gcc,而stack显然正在使用的/usr/local/bin/gcc有此问题。我为解决此问题而做的是删除/usr/bin/gcc并仅保留Name protection