gpt4 book ai didi

rust - M1 Mac 在编译 rust 代码时遇到错误

转载 作者:行者123 更新时间:2023-12-03 11:46:31 28 4
gpt4 key购买 nike

我已经开始使用 Mac m1,当我尝试编译或构建 rust 代码时,它会给我错误,如下所示。请任何人给我建议如何使用 m1 构建一个 Rust 项目。

发生错误:找不到工具。是否安装了 `musl-gcc`

Caused by:
process didn't exit successfully: `/Users/vlas/workspace/atomicDEX-API/target/debug/build/secp256k1-sys-a8b7f720201711aa/build-script-build` (exit code: 1)
--- stdout
TARGET = Some("x86_64-unknown-linux-musl")
OPT_LEVEL = Some("0")
HOST = Some("aarch64-apple-darwin")
CC_x86_64-unknown-linux-musl = None
CC_x86_64_unknown_linux_musl = None
TARGET_CC = None
CC = None
CROSS_COMPILE = None
CFLAGS_x86_64-unknown-linux-musl = None
CFLAGS_x86_64_unknown_linux_musl = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
CC_x86_64-unknown-linux-musl = None
CC_x86_64_unknown_linux_musl = None
TARGET_CC = None
CC = None
CROSS_COMPILE = None
CFLAGS_x86_64-unknown-linux-musl = None
CFLAGS_x86_64_unknown_linux_musl = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
CC_x86_64-unknown-linux-musl = None
CC_x86_64_unknown_linux_musl = None
TARGET_CC = None
CC = None
CROSS_COMPILE = None
CFLAGS_x86_64-unknown-linux-musl = None
CFLAGS_x86_64_unknown_linux_musl = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
running: "musl-gcc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "depend/secp256k1/" "-I" "depend/secp256k1/include" "-I" "depend/secp256k1/src" "-Wall" "-Wextra" "-DSECP256K1_BUILD=1" "-DENABLE_MODULE_ECDH=1" "-DECMULT_GEN_PREC_BITS=4" "-DUSE_NUM_NONE=1" "-DUSE_FIELD_INV_BUILTIN=1" "-DUSE_SCALAR_INV_BUILTIN=1" "-DECMULT_WINDOW_SIZE=15" "-DUSE_EXTERNAL_DEFAULT_CALLBACKS=1" "-DUSE_ENDOMORPHISM=1" "-o" "/Users/vlas/workspace/atomicDEX-API/target/x86_64-unknown-linux-musl/debug/build/secp256k1-sys-14880e4c64cda3d3/out/depend/secp256k1/contrib/lax_der_parsing.o" "-c" "depend/secp256k1/contrib/lax_der_parsing.c"

--- stderr


error occurred: Failed to find tool. Is `musl-gcc` installed?

最佳答案

看来你缺少一个链接器

brew install filosottile/musl-cross/musl-cross

关于rust - M1 Mac 在编译 rust 代码时遇到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66363408/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com