1

Compiling getrandom v0.2.10 error: target is not supported, for more information see: https://docs.rs/getrandom/#unsupported-targets --> src/lib.rs:290:9 | 290 | / compile_error!("target is not supported, for more information see:
291 | | https://docs.rs/getrandom/#unsupported-targets"); | |________________________________________________________________________^

error[E0433]: failed to resolve: use of undeclared crate or module imp --> src/lib.rs:341:9 | 341 | 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...

4
  • anchor init test --> ok
    – lvig
    Commented Jun 8, 2023 at 9:13
  • just after : anchor build --> failed on getrandom
    – lvig
    Commented Jun 8, 2023 at 9:14
  • cargo 1.70.0 solana-cli 1.16.0 anchor-cli 0.27.0 rustc 1.70.0
    – lvig
    Commented Jun 8, 2023 at 9:23
  • Who has the same problem?
    – lvig
    Commented Jun 8, 2023 at 9:45

1 Answer 1

1

There is currently a bug on 1.16.0. Update your solana cli version to 1.14.17 with:

[dependencies]
solana-program = "=1.14.17"

Once you update the Anchor build should complete successfully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.