ITADN

[Bug]: 在 macOS 下编译报错

#72Openyibie 创建于 2026-04-25
bug
Y
yibiecommented
### Bug summary 报错信息现实缺少 `gmp-mpfr-sys` 这个包,但是本地 Homebrew 里显示 `gmp` 已经安装。 具体报错信息: > error: failed to run custom build command for `gmp-mpfr-sys v1.7.0` > > Caused by: > process didn't exit successfully: `/Users/chenyibin/Documents/prj/neomacs/target/release/build/gmp-mpfr-sys-2feab66fc797a958/build-script-build` (exit status: 101) > --- stdout > cargo:rerun-if-env-changed=GMP_MPFR_SYS_CACHE > $ mkdir -p "/Users/chenyibin/Documents/prj/neomacs/target/release/build/gmp-mpfr-sys-4070402a884b5376/out/lib" > $ mkdir -p "/Users/chenyibin/Documents/prj/neomacs/target/release/build/gmp-mpfr-sys-4070402a884b5376/out/include" > $ rm -r "/Users/chenyibin/Documents/prj/neomacs/target/release/build/gmp-mpfr-sys-4070402a884b5376/out/build/system_libs" > $ mkdir -p "/Users/chenyibin/Documents/prj/neomacs/target/release/build/gmp-mpfr-sys-4070402a884b5376/out/build/system_libs" > $ cd "/Users/chenyibin/Documents/prj/neomacs/target/release/build/gmp-mpfr-sys-4070402a884b5376/out/build/system_libs" > $ #Check for system GMP > $ printf '%s' "/* system_"... > "/Users/chenyibin/Documents/prj/neomacs/target/release/build/gmp-mpfr-sys-4070402a884b5376/out/build/system_libs/system_gmp.c" > $ cd "/Users/chenyibin/Documents/prj/neomacs/target/release/build/gmp-mpfr-sys-4070402a884b5376/out/build/system_libs" && "gcc" "-fPIC" "system_gmp.c" "-lgmp" "-o" "system_gmp.exe" > > --- stderr > system_gmp.c:2:10: fatal error: 'gmp.h' file not found > 2 | #include <gmp.h> > | ^~~~~~~ > 1 error generated. > > thread 'main' (1140574) panicked at /Users/chenyibin/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/gmp-mpfr-sys-1.7.0/build.rs:1221:13: > Program failed with code 1: cd "/Users/chenyibin/Documents/prj/neomacs/target/release/build/gmp-mpfr-sys-4070402a884b5376/out/build/system_libs" && "gcc" "-fPIC" "system_gmp.c" "-lgmp" "-o" "system_gmp.exe" > note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace > warning: build failed, waiting for other jobs to finish... > ^[[Aerror: command failed with status exit status: 101: /Users/chenyibin/.rustup/toolchains/1.93.1-aarch64-apple-darwin/bin/cargo build -p neomacs-bin --release ### Steps to reproduce _No response_ ### Expected behavior _No response_ ### Runtime diagnostics ```shell ``` ### Extra context _No response_
6 条评论