Comments (18)
to resolve this Error Simply Run 2 Commands
1- cargo add solana-program@=1.17.0
Then Run
2- cargo update -p solana-program
After Simply Run : anchor build
. and you Good To Go
from solana.
and then if I follow the advice for cargo add solana-program@=1.17.0
then I end up with new errors
from solana.
You have two options to resolve this without downgrading:
- Upgrade to the 1.18 tools with
solana-install init 1.18.0
- As of
cargo build-sbf
that comes bundled with 1.16, you can use the--tools-version
argument to use a different version of the build tools. Version 1.39 of the build tools contains a Rust compiler at 1.72, so you can run:cargo build-sbf --tools-version v1.39
from solana.
@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! 😂❤️❤️
from solana.
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
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
from solana.
@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 =
sign inside the quotes in my Cargo.toml
to make the version stick:
solana-program = "=1.17.17"
Perfect response though and I greatly appreciate it! 👊🏻
from solana.
@jakerumbles if you are facing issue like use of unstable library feature 'build_hasher_simple_hash_one'
in your respective project. locate the folder.
programs/xyz_proj_name/cargo.toml
file. it will work if you are using solana-program = { version = "=1.17.0"}
Simply you have to add the dependency list.
[dependencies] ahash = "=0.8.6"
i tried and it works in my case. So you can also Try.
from solana.
#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 🤣
from solana.
People ask about this error all the time so I'm linking #31428 once again.
from solana.
Looks like someone on the team forgot to update the sbf sdk before releasing 1.18.0.
Basically when you build a solana program with cargo-build-sbf
, you're not actually using your system's rust compiler. You're using one with changes necessary for building solana programs (repo: https://github.com/solana-labs/rust). This is typically located at ~/.local/share/solana/install/active_release/bin/sdk/sbf/dependencies/platform-tools
if you had installed it with the provided shell script.
You can check which version of of rustc cargo-build-sbf
is using by running cargo-build-sbf --version
which should output something like this:
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 solana-tools-v1.39
tag on their rust fork linked above) but I guess someone forgot to update the install tool script. Your best bet is probably to downgrade to 1.17 for now. 1.18 is marked as a pre-release anyway.
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
from solana.
Yes!, it worked.
I deleted the cargo.lock file and than use cargo add solana-program@=1.17.0
and than typed anchor build it worked . Thanks man.
from solana.
In general you need your solana tools versions to match whatever version of solana-program
is being used in your program.
To handle working with multiple solana-program
versions across different programs, I keep the following bash alias around to change the symlink of the active solana release to the desired version:
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 cargo-build-sbf --version
and if they aren't after changing the solana version, you can use cargo-build-sbf --force-tools-install
to install the correct one.
from solana.
Forced 1.17 as suggested @billythedummy . Did it just like @hammad-ali18 did by running cargo add solana-program@=1.17.0
That worked! Well it worked to update my crates to 1.17 but now it opened up more errors.
error: linker cc
not found
|
= note: No such file or directory (os error 2)
error: could not compile proc-macro2
due to previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile semver
due to previous error
error: could not compile syn
due to previous error
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.
from solana.
error: linker cc not found
|
= note: No such file or directory (os error 2)
Do you have build-essential and pkg-config apt installed?
from solana.
@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.
from solana.
bleh... fresh install on brand new server. build-essential, pkg-config and every other thing I could think of, search or make up to install beforehand and this is what we get.
from solana.
and then if I follow the advice for
cargo add solana-program@=1.17.0
then I end up with new errors
I was having the same issue and I solved it with this
cargo update -p [email protected] --precise 0.8.6
from solana.
Thanks a ton @hamzagill906! It compiles now with this for my cargo.toml
from solana.
Related Issues (20)
- Nearly impossible to deploy or upgrade Solana program (contract) HOT 6
- Bug deploying new program HOT 1
- Timed out sending 339 transactions when i want to deploy on mainnet HOT 1
- spl-token initialize-metadata fails with Invalid instruction HOT 1
- I encountered a problem when writing a smart contract HOT 1
- Stack Size increased with 1.18.x (platform-tools) HOT 2
- Invalid setup instructions for Solana CLI on MacOS HOT 1
- Unable to deploy program using solana cli `1.18.12` HOT 1
- Issue with RocksDB growth in Solana private cluster despite low transaction volume HOT 1
- Why solana command does not support calling function HOT 1
- Virus detection flagging cargo-build-bpf.exe as malware (cargo-test-bpf.exe too). HOT 1
- build error: Stack offset of 4608 exceeded max offset of 4096 with v1.18.10 HOT 1
- websocket error reporting HOT 1
- rpc node can't catchup HOT 2
- The solana-web3.js transaction confirmation logic with "confrimed" is stuck when transaction had been finalized HOT 1
- cargo build-sbf Can't get home directory path: environment variable not found HOT 1
- Sending transaction via QUIC (TimedOut) HOT 1
- Error detecting Windows path folder HOT 1
- Large stack error HOT 1
- `solana-test-validator` halts continuosly HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solana.