I am trying to run cargo build-bpf on a basic start rust program.
I installed Rust with the curl command curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh.
When I run cargo --version I get cargo 1.75.0 (1d8b05cdd 2023-11-20).
When I run rustc --version I get rustc 1.75.0 (82e1608df 2023-12-21).
But in my project directory, when I run cargo build-bpf I get an error saying:
error: package `package` cannot be built because it requires rustc 1.72.0 or newer, while the currently active rustc version is 1.68.0-dev
How is it using version 1.68.0-dev? I tried running rustup update but I still get the 1.68.0-dev error?
I ran
solana-install updateand it said "Install is up to date".Ran
cargo build-bpfagain and got error:To fix it I ran the following:
solana-install init 1.18.1and then when I rancargo build-bpfagain it worked.