【发布时间】:2022-06-17 23:00:27
【问题描述】:
问题 当我尝试运行锚构建时,出现以下错误:
error: target is not supported, for more information see: https://docs.rs/getrandom/#unsupported-targets
--> /Users/mac/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.1.16/src/lib.rs:267:9
|
267 | / compile_error!("\
268 | | target is not supported, for more information see: \
269 | | https://docs.rs/getrandom/#unsupported-targets\
270 | | ");
| |___________^
error[E0433]: failed to resolve: use of undeclared crate or module `imp`
--> /Users/mac/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.1.16/src/lib.rs:292:5
|
292 | imp::getrandom_inner(dest)
| ^^^ use of undeclared crate or module `imp`
For more information about this error, try `rustc --explain E0433`.
error: could not compile `getrandom` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
环境:
solana-cli 1.8.13 (src:42c3fbc1;feat:1006352700)
rustup 1.24.3 (ce5817a94 2021-05-31)
rustc 1.61.0 (fe5b13d68 2022-05-18)
锚-cli 0.24.2
【问题讨论】:
-
运行 cargo build-bpf 时,我遇到了同样的问题。只是用 cargo build 运行它是没有错误的。