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?
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.
I did brew uninstall ghc && brew install ghc
and it fixed it (on Yosemite).
This worked for me on OSX (10.15) Catalina:
brew install pkg-config hidapi libev gmp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With