GHC任何导致"ld:找不到-lgmp的库"

bsc*_*ter 14 haskell ghc osx-yosemite osx-elcapitan

我正在尝试在我的运行OS X 10.10 Yosemite的mac上编译haskell程序,但是每次使用ld:找不到-lgmp的库时ghc都会失败:

$ ghc foo.hs
[1 of 1] Compiling Main             ( foo.hs, foo.o )
Linking foo ...
ld: library not found for -lgmp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

救命?

bsc*_*ter 33

我系统上缺少的东西是来自xcode的最新命令行工具.安装最新版本并xcode-select --install修复了问题.

  • 完美修复(升级到El Captain后).再次感谢! (7认同)