为什么“anchor build”和“Cargo build-bpf”显示错误的 rustc 版本?

2024-01-01

我正在尝试构建(https://github.com/betterclever/solend-anchor https://github.com/betterclever/solend-anchor) 包使用anchor build,但是我收到以下错误

error: package `uint v0.9.3` cannot be built because it requires rustc 1.56.1 or newer, while the currently active rustc version is 1.56.0-dev

我更新了 rustc 并运行命令rustup default nightlyshows:

info: using existing install for 'nightly-x86_64-apple-darwin'
info: default toolchain set to 'nightly-x86_64-apple-darwin'

  nightly-x86_64-apple-darwin unchanged - rustc 1.61.0-nightly 

所以它向我显示已安装和活动的 rustc 版本是 1.61,但是锚构建由于某种原因没有找到它。我也尝试运行 Cargo build-bpf 但同样的事情不断发生。cargo build似乎工作正常。 我想知道运行anchor build 和cargo build-bpf 时导致问题的原因是什么?


anchor build and cargo build-bpf使用与普通编译器不同的编译器rustc编译器包含在系统中,因此它们报告不同的版本是正常的。 BPF 编译器附带 Solana 工具套件。

如果您的计算机上已安装 Solana 工具,则只需运行:

solana-install init 1.9.13

如果你不这样做,你可以运行:

sh -c "$(curl -sSfL https://release.solana.com/v1.9.13/install)"

这将为您提供所有最新的工具,包括 BPF 编译器。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

为什么“anchor build”和“Cargo build-bpf”显示错误的 rustc 版本? 的相关文章

随机推荐