2

I am trying to start a Solana project on Windows. When I run cargo build in cmd, it works fine; but for cargo build-bpf, I get an error:

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

I tried installing WSL, but when I run cargo build or cargo build-bpf, I get this error:

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

How can I solve the problem?

Pang
  • 9,564
  • 146
  • 81
  • 122
Kgee
  • 53
  • 1
  • 5

1 Answers1

1

You may be using an older version of Rust that doesn't provide the host triple, so be sure that you're using the latest stable in wsl. More information at How can I query rustc for the host triple?

Before going to WSL, you can also try running cargo build-bpf from a shell supporting Bash, such as Git Bash on Windows: https://gitforwindows.org/

Jon C
  • 7,019
  • 10
  • 17