Not able to build a project because of this issue:

error: linking with `cc` failed: exit status: 1
  = note: "cc" "-arch" "arm64" "/var/folders/5w/j2mkxftx2xz55c696xp23gzh0000gn/T/rustciwy51y/symbols.o" "/Users/elioprifti/dkg-substrate/target/debug/deps/dkg_standalone_node-3e72bef5f25657ad.10sw7xj1rkq1p2nk.rcgu.o" "/Users/elioprifti/dkg-substrate/target/debug/deps/dkg_standalone_node-3e72bef5f25657ad.10ut9rvejkcsmvr1.rcgu.o" "/Users/elioprifti/dkg-substrate/target/debug/deps/dkg_standalone_node-3e72bef5f25657ad.112iyrdupdm8w5vw.rcgu.o" "/Users/elioprifti/dkg-substrate/target/debug/deps/elioprifti/.rustup/toolchains/nightly-2022-05-15-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-d0e3d0b2f5dc30fb.rlib" "/Users/elioprifti/.rustup/toolchains/nightly-2022-05-15-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-12083e42f9a7d1fc.rlib" "/Users/elioprifti/.rustup/toolchains/nightly-2022-05-15-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-def158ba03cb504e.rlib" "/Users/elioprifti/.rustup/toolchains/nightly-2022-05-15-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-e83dd9bd71bd52bd.rlib" "/Users/elioprifti/.rustup/toolchains/nightly-2022-05-15-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-a149d8756e403a5c.rlib" "/Users/elioprifti/.rustup/toolchains/nightly-2022-05-15-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-95a7e52c78a3fba1.rlib" "/Users/elioprifti/.rustup/toolchains/nightly-2022-05-15-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-dd6de681850a671c.rlib" "/Users/elioprifti/.rustup/toolchains/nightly-2022-05-15-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-ec608688b97371b8.rlib" "-lgmp" "-framework" "Security" "-framework" "Security" "-lc++" "-framework" "SystemConfiguration" "-framework" "Security" "-framework" "CoreFoundation" "-liconv" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv" "-L" "/Users/elioprifti/.rustup/toolchains/nightly-2022-05-15-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/Users/elioprifti/dkg-substrate/target/debug/deps/dkg_standalone_node-3e72bef5f25657ad" "-Wl,-dead_strip" "-nodefaultlibs"
  = 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 `dkg-standalone-node` due to previous error
warning: build failed, waiting for other jobs to finish...
elioprifti@pc-193-62 dkg-substrate % 

I can build other projects but not this one. Any idea?

  • Have you run xcode-select --install?
    – Bruno
    Nov 23 at 17:36
  • I have run it but still the same.
    – P.E
    Nov 23 at 18:04
  • If you're using stable-aarch64-apple-darwin toolchain, you could try switching to stable-x86_64-apple-darwin and see if that resolves the issue.
    – Bruno
    Nov 23 at 18:12
  • I tried. Still the same!
    – P.E
    Nov 23 at 19:21
  • If you search for ld: library not found for you will get lots of similar errors which may help in troubleshooting this issue.
    – Bruno
    Nov 23 at 21:02

1 Answer 1


I assume you are trying to build dkg-substrate, not substrate or the node template.
In your case the GMP library seems to be missing.
Their CI file indicates some libs that are needed here, eg libgmp3-dev. There is also tutorial for building it here.

  • I was able to install the GMP library but still have the same issue!
    – P.E
    Nov 23 at 17:07
  • 1
    Then open an issue in their GitHub or ask in chat first if mac is supported. Nov 23 at 17:40
  • Already did, they do not know how to fix it.
    – P.E
    Nov 23 at 20:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.