我正在编译一个使用货物构建的pyo3示例代码。我在最后看到了这个错误
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)其他代码编译得很好。只有在使用pyo3时才会看到此错误。
我用的是MacBook和M1芯片。我已经安装了Xcode。锈蚀工具链稳定-aarch64苹果-达尔文(默认)Python3.82 (arm64)
这就是我如何看待我对pyo3的依赖。
[dependencies.pyo3]
version = "0.14.5"
features = ["extension-module"]什么对我有用
有没有其他人有问题,编译锈迹与arm Mac?
这是我正在尝试https://github.com/bedroombuilds/python2rust/tree/main/15_pymod_in_rust/rust/pyo3_monte_carlo_pi的示例代码
发布于 2021-09-10 08:39:39
我设法通过将这个添加到cargo.toml文件来解决这个问题。
[target.x86_64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
[target.aarch64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]https://stackoverflow.com/questions/69129475
复制相似问题