1

我正在尝试使用 Windows 启动一个 solana 项目,当我在 Cmd 上运行 cargo build 时它工作正常,但 cargo build-bpf 我收到错误:

BPF SDK: \\?\C:\Users\HP\.local\share\solana\install\releases\1.9.4\solana-release\bin\sdk\bpf
Can't get home directory path: environment variable not found

所以我尝试安装 wsl 但是当我运行 cargo build 或 cargo build-bpf 时出现错误:

error: `rustc -vV` didn't have a line for `host:`, got:
4

1 回答 1

1

您可能正在使用不提供主机三元组的旧版 Rust,因此请确保您使用的是 wsl 中最新的稳定版。更多信息在如何查询 rustc 以获取主机三元组?

在去 WSL 之前,您还可以尝试cargo build-bpf从支持 Bash 的 shell 运行,例如 Windows 上的 Git Bash:https ://gitforwindows.org/

于 2022-01-24T12:16:42.087 回答