1

The error goes like this:

PS D:\solonacontracts\solana-counter\programs\counter-app> anchor build BPF SDK: \?\C:\Users\Prabh.local\share\solana\install\releases\1.10.31\solana-release\bin\sdk\bpf cargo-build-bpf child: rustup toolchain list -v cargo-build-bpf child: rustup toolchain uninstall bpf info: uninstalling toolchain 'bpf' info: toolchain 'bpf' uninstalled cargo-build-bpf child: rustup toolchain link bpf \?\C:\Users\Prabh.local\share\solana\install\releases\1.10.31\solana-release\bin\sdk\bpf\dependencies\bpf-tools\rust cargo-build-bpf child: cargo +bpf build --target bpfel-unknown-unknown --release error: no such subcommand: +bpf

    Did you mean `b`?
    
    
    

PS D:\solonacontracts\solana-counter\programs\counter-app> rustup toolchain list -v stable-x86_64-pc-windows-msvc (default) C:\Users\Prabh.rustup\toolchains\stable-x86_64-pc-windows-msvc bpf C:\Users\Prabh.cache\solana\v1.27\bpf-tools\rust 1.59.0-x86_64-pc-windows-msvc C:\Users\Prabh.rustup\toolchains\1.59.0-x86_64-pc-windows-msvc PS D:\solonacontracts\solana-counter\programs\counter-app>

1
  • can you please clean up the formatting here by putting command invocations and their output in separate code blocks? as is, this is impossible to read
    – trent.sol
    Jul 22, 2022 at 5:48

2 Answers 2

1

You actually can build with Windows natively! The tools all work, but you must run from within a bash-supported shell.

Try installing Git Bash and then retrying your build from there https://git-scm.com/download/win

0

As far as I know, Solana development isn't being supported by Windows, so it's pretty much impossible to run build-bpf command. You might need a Linux machine for that. So either :

I personally got WSL for the sake of simplicity. Either way you'll need to learn how Linux terminal works, which is pretty similar to Power Shell, but it has its own caveats. I recommend watching this video about the Linux terminal, if you want to learn more : https://youtu.be/s3ii48qYBxA

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.