Reputation: 4039
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?
Upvotes: 14
Views: 4621
Reputation: 61
This worked for me on OSX (10.15) Catalina:
brew install pkg-config hidapi libev gmp
Upvotes: 1
Reputation: 26059
I did brew uninstall ghc && brew install ghc
and it fixed it (on Yosemite).
Upvotes: 3
Reputation: 4039
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.
Upvotes: 33