Closed chiro-hiro closed 2 years ago
error: linking with `cc` failed: exit status: 1 [....] = note: ld: library not found for -lgmp clang: error: linker command failed with exit code 1 (use -v to see invocation) error: could not compile `ecdsa-mpc` due to previous error
Install GMP with homebrew:
brew install gmp
Make sure gmp linked:
brew link --force gmp
Create file .cargo/config in source code folder:
.cargo/config
[target.x86_64-apple-darwin] rustflags = [ "-L", "/opt/homebrew/lib", "-L", "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib", "-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup", ] [target.aarch64-apple-darwin] rustflags = [ "-L", "/opt/homebrew/lib", "-L", "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib", "-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup", ]
These flags was used to guide rustc to look up libraries from homebrew. I'm prefer an official patch.
rustc
Build error
How to fix?
Install GMP with homebrew:
Make sure gmp linked:
Create file
.cargo/config
in source code folder:These flags was used to guide
rustc
to look up libraries from homebrew. I'm prefer an official patch.