Schlueter
Schlueter

Reputation: 4039

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?

Upvotes: 14

Views: 4621

Answers (3)

Excel
Excel

Reputation: 61

This worked for me on OSX (10.15) Catalina:

brew install pkg-config hidapi libev gmp

Upvotes: 1

charlax
charlax

Reputation: 26059

I did brew uninstall ghc && brew install ghc and it fixed it (on Yosemite).

Upvotes: 3

Schlueter
Schlueter

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

Related Questions