我正在关注Udemy Haskell课程,有一次我看到我使用Stack选项下载Haskell。当我遇到问题时,我已经配置了我的$ PATH并运行了堆栈设置。
timer = timerWithDifferentIntervals(interval: 1, target: self, selector: #selector(handle1), userInfo: nil, repeats: true)
我调查了configure: WARNING: configure can't recognize your CPP program, you may need to set --with-hs-cpp-flags=FLAGS explicitly
configure: error: in `/Users/Dylan/.stack/programs/x86_64-osx/ghc-8.0.2.temp/ghc-8.0.2':
configure: error: C compiler cannot create executables
并发现了这个......
.stack/programs/x86_64-osx/ghc-8.0.2.temp/ghc-8.0.2/config.log
我能够阅读configure:2234: checking for path to top of build tree
configure:2255: result: /Users/Dylan/.stack/programs/x86_64-osx/ghc-8.0.2.temp/$
configure:2981: checking for perl
configure:2999: found /usr/bin/perl
configure:3011: result: /usr/bin/perl
configure:3070: checking for a BSD-compatible install
configure:3138: result: /usr/bin/install -c
configure:3152: checking whether ln -s works
configure:3156: result: yes
configure:3168: checking for gsed
configure:3199: result: sed
configure:3211: checking XCode version
configure:3222: result: 8.3.3
configure:3226: XCode version component 1: 8
configure:3228: XCode version component 2: 3
configure:3263: checking for gcc
configure:3281: found /usr/bin/gcc
configure:3293: result: /usr/bin/gcc
configure:3573: WARNING: configure can't recognize your CPP program, you may ne$
configure:3623: checking for llc-3.7
configure:3656: result: no
configure:3739: checking for llc
configure:3772: result: no
configure:3872: checking for opt-3.7
configure:3905: result: no
configure:3988: checking for opt
configure:4021: result: no
configure:4120: checking for ld
configure:4138: found /usr/bin/ld
configure:4150: result: /usr/bin/ld
configure:4388: checking for gcc
configure:4415: result: /usr/bin/gcc
configure:4644: checking for C compiler version
configure:4653: /usr/bin/gcc --version >&5
,但我不确定如何或在何处这样做。我找到了我的settings.in文件......
configure: WARNING: configure can't recognize your CPP program, you may need to set --with-hs-cpp-flags=FLAGS explicitly
但同样,我不知道该如何处理它。对不起,如果我的问题是基本的,但我之前没有做过类似的事情,我在网上找到的内容很难解释它是如何适用于我的情况。
非常感谢任何帮助。
答案 0 :(得分:3)
@n.m发表了一个链接,引导我回答一个问题,建议我查看我的xCode列出的开发人员命令行工具版本。事实证明我的版本很好,但我后来在.stack/programs/x86_64-osx/ghc-8.0.2.temp/ghc-8.0.2/config.log
找到了这一行,这使我找到了解决问题的方法。
Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command
sudo xcodebuild -license
允许我成功运行stack install
。