Search code examples
haskellosx-yosemiteghcosx-elcapitan

GHC anything results in "ld: library not found for -lgmp"


I'm trying to compile haskell programs on my mac running OS X 10.10 Yosemite, but ghc fails every time with ld: library not found for -lgmp:

$ 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)

Help?


Solution

  • The missing thing on my system was up to date command line tools from xcode. Installing the most recent version with xcode-select --install fixed the problem.