rust-gmp-kzen gmp 绑定问题:“dyld[...]:缺少名为”的符号

问题描述 投票:0回答:1

我正在使用 rust-gmp-kzen 库,它将 rust 绑定到 gmp。当我运行 rust 程序时,它在语句“BigInt::one();”处中止其中调用“__gmpz_init_set_ui”。 我重新安装了 gcc、gmp、rustup vs,但是问题仍然出现。

dyld[77446]: missing symbol called

我在网上搜索了很多,但没有找到相关的解决方案。任何人都可以知道这个问题吗?

gcc rust gmp bigint abort
1个回答
0
投票

Rustup和cargo使用arm64架构。然而 gmp 库适用于 x86_64 架构。因此,当链接 gmp 库时,rust 无法找到该库并中止。

我卸载了 rustup :

cargo self uninstall

然后再次安装,选择 x86_64-apple-darwin 而不是 arch64

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

© www.soinside.com 2019 - 2024. All rights reserved.