Problem with Rust install fail in windows 10 (C ++ issue)

Hi. I’m hoping I can get some assistance on this issue
(Running Windows 10)
I’m following tutorial on Solana to learn its coding + SPL deployment , management
When I got to rust install - failed at back end, as follows:

Note; I first got prompts from Solana tool suite to update VS C++ 2015 - 2019 as mine was out of date
(Mine was VS C++ 2017) I did this and Solana tools then installed no problem

When following Rust/Cargo tool build install - I was prompted to install VS 2019 Developer
I have done this

** Visual Studio 2019 Developer Command Prompt v16.11.5
** Copyright (c) 2021 Microsoft Corporation

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>cargo install spl-token-cli
Updating index
Installing spl-token-cli v2.0.15
Compiling proc-macro2 v1.0.30
Compiling syn v1.0.80
error: linker link.exe not found
= note: The system cannot find the file specified. (os error 2)

note: the msvc targets depend on the msvc linker but link.exe was not found

note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed with the Visual C++ option

error: could not compile syn due to previous error
warning: build failed, waiting for other jobs to finish…
error: failed to compile spl-token-cli v2.0.15, intermediate artifacts can be found at C:\Users\AZ\AppData\Local\Temp\cargo-install8fm6AF

Caused by:
build failed

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>

Has anyone had this issue?
can anyone recommend the VS software packs that will solve this
Clearly I’m missing something, and I’ve tried to follow the help note from cargo above
about installing the correct software, but its still not functioning and build fails.

Any help would be much appreciated
(Ps. Ive run the build attempts in standard command prompt and also VS command prompt)

Hey there @Anthoozia, and welcome to the forum!

According to the Solana smart contract hello-world example they recommend using WSL to compile the smart contract on Windows. This means installing the Solana CLI and the other smart contract tools all inside of a WSL terminal.

Note: WSL, if you don’t already know what it is, is essentially a virtual Linux environment integrated with your Windows machine. Because building software is often much easier in Linux, it can be used to streamline build processes when you are Windows, by simply building inside of a Linux environment and using Linux software.

Hi Zicklag
Thanks for the reply. Will check it out.

I’ve actually found the solve for the C++ link.exe issue, there were some C++ distributables that did not get installed
I backtracked to the installer suite and found they were still pending installation, all solved now!
SPL is installing. Thanks for the advice, I will still check into WSL and check out its functionality
Good to know there is Linux VM available - cheers!

1 Like