-
Notifications
You must be signed in to change notification settings - Fork 4.6k
error: package solana-program v1.18.0
cannot be built because it requires rustc 1.72.0 or newer, while the currently active rustc version is 1.68.0-dev
#34987
Comments
Basically when you build a solana program with You can check which version of of rustc solana-cargo-build-sbf 1.17.6
platform-tools v1.37
rustc 1.68.0 By right, solana v1.18.0 should be using their patched version of rustc 1.72 (the default EDIT: sorry, had this issue confused with #32361 (comment) and thought that the install script wasnt working correctly. Just tried the build tools for 1.18, it works fine, installs the patched rustc 1.72 and all |
Yes!, it worked. |
In general you need your solana tools versions to match whatever version of To handle working with multiple function solana_vers() { ln -sfn ~/.local/share/solana/install/releases/$1/solana-release ~/.local/share/solana/install/active_release; }
alias solanavers="solana_vers"
# Example usage: solanavers 1.18.0 You can confirm that your build tools are the correct version using |
Forced 1.17 as suggested @billythedummy . Did it just like @hammad-ali18 did by running That worked! Well it worked to update my crates to 1.17 but now it opened up more errors. error: linker error: could not compile I am still doing the Hello World program on the solana site not on Anchor. I'm over it though. I want nothing to do with Trying to learn where the Hello World tutorial is busted. Lmao. |
Do you have build-essential and pkg-config apt installed? |
@billythedummy I did not have them installed. I'm going to nuke my server and start yet again lol. Have you tried running line by line through the install on a fresh build to see where we are getting stuck? I'm sorry that's a bit of an ask but I'd really like to see your process to get around our issue. |
to resolve this Error Simply Run 2 Commands After Simply Run : |
You have two options to resolve this without downgrading:
|
@hamzagill906 thank you so much. I actually solved it a couple hours ago and I'll pin it here when I figure out how to do that and wake up! 😂. Had 1.5 hours of sleep before getting my son to school after coding last night. I had to do one thing in addition to what you said and that was put the Perfect response though and I greatly appreciate it! 👊🏻 |
@joncinque Great info! This what I'm talking about. A few nuggets of info like this added to the docs and the tutorials would save a lot of people much grief when first arriving. Plus save a whole lot more people from hearing my bitching! 😂❤️❤️ |
@jakerumbles if you are facing issue like in your respective project. locate the folder. Simply you have to add the dependency list.
i tried and it works in my case. So you can also Try. |
#34991 Was where I finally had the aha moment and listened to everyone about making cli and solana-program line up but the comments in here are solving it as well! Sorry for the commotion yesterday but it appears many more of us a getting it installed properly 🤣 |
This issue blind-sided me too if I'm being honest 😅 I wrote up this Stack Exchange question in the hopes that others find it: https://solana.stackexchange.com/questions/9798/error-building-program-with-solana-program-v1-18-and-cli-v1-17/9799#9799 If there are no more questions, I'll close this issue |
People ask about this error all the time so I'm linking #31428 once again. |
I was having the same issue and I solved it with this
|
Thanks a ton @hamzagill906! It compiles now with this for my cargo.toml |
Problem
I am using anchor framework ,and running anchor build.
I am having a problem between solana-program and rustc , I have confirme rustc --version 1.72.0 on my console, where I am getting the problem?
error: package
![anchorerror](https://private-user-images.githubusercontent.com/91586903/300211480-422eb9e4-7340-477f-9b0b-56b4229d0efc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNjU5MDIsIm5iZiI6MTczOTE2NTYwMiwicGF0aCI6Ii85MTU4NjkwMy8zMDAyMTE0ODAtNDIyZWI5ZTQtNzM0MC00NzdmLTliMGItNTZiNDIyOWQwZWZjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDA1MzMyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWEwNzMyM2UxZTIxNzFlMTgxNWRiNTM2N2VhYjU1MjEwNTNiOWE2OTk4NzNkN2FmZDA2MTk5MGFlMWQ5NDBhMWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Clwd8lS94BO_-WzMNV59zjqG8Dfkk1spwK7rAQt8wbo)
solana-program v1.18.0
cannot be built because it requires rustc 1.72.0 or newer, while the currently active rustc version is 1.68.0-devProposed Solution
The text was updated successfully, but these errors were encountered: