coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.36k stars 1.25k forks source link

anchor build fails with solana-program cannot be built because it requires rustc 1.75.0 or newer #3012

Closed webberXXII closed 3 weeks ago

webberXXII commented 3 weeks ago

getting this error when trying to build anchor even tho my rustc version is updated

USER:/mnt/c/solana/program$ anchor build
error: package `solana-program v1.18.15` cannot be built because it requires rustc 1.75.0 or newer, while the currently active rustc version is 1.68.0-dev
Either upgrade to rustc 1.75.0 or newer, or use
cargo update -p solana-program@1.18.15 --precise ver
where `ver` is the latest version of `solana-program` supporting rustc 1.68.0-dev

solana-cli 1.17.25 rustc 1.78.0 rustup 1.27.1 anchor-cli 0.30.

acheroncrypto commented 3 weeks ago

You need to update your solana-cli, you can do so by:

solana-install init 1.18.15

See https://github.com/solana-labs/solana/issues/31428 for an explanation.