I have just started with rust and solana.Firstly, I created a solana program using the command:
cargo init hello_world --lib
everything ran fine, and then i read from the official docs, to build i ran the command:
cargo build-sbf
this command is not running at all.The errors i got:platform tools 404 not found (solved)
now after some days, i tried again:deleted the initial project and created "hello_world" again using the same command.by default the cargo.lock is creating a version = 4 and someone suggested to change it to 3, i did.
The error i am stucked at now is:
MacBook-Air hello_world % cargo build-sbferror: package `solana-program v1.18.26` cannot be built because it requires rustc 1.75.0 or newer, while the currently active rustc version is 1.68.0-devEither upgrade to rustc 1.75.0 or newer, or usecargo update -p solana-program@1.18.26 --precise verwhere `ver` is the latest version of `solana-program` supporting rustc 1.68.0-dev
The versions on my system right now is:
MacBook-Air hello_world % rustc --version; solana --version; cargo --version;rustc 1.75.0 (82e1608df 2023-12-21)solana-cli 1.16.10 (src:382b3f16; feat:3712769919, client:SolanaLabs)cargo 1.75.0 (1d8b05cdd 2023-11-20)
i did everything i knew, and i am not able to just build my program.
Also, using rustup show, the output is:
MacBook-Air hello_world % rustup showDefault host: x86_64-apple-darwinrustup home: /Users/sani/.rustupinstalled toolchains--------------------stable-x86_64-apple-darwin1.75.0-x86_64-apple-darwin (default)solanaactive toolchain----------------1.75.0-x86_64-apple-darwin (directory override for '/Users/sani/Desktop/projects/hello_world')rustc 1.75.0 (82e1608df 2023-12-21)
Any help on what I can do?
PS: I know i can use solana playground but i want to setup the local environment for learning.