Hi!
I'm new on this.
I've installed rust on WSL with ubuntu 18.04 LTS AND on windows (after installing on WSL), in ubuntu all works fine, but on windows when I try to cargo run or cargo build, this happens.
I don't know how you've managed it, but you appear to have gotten Rust to invoke the MSYS linker, rather than the MSVC linker. That's not going to work.
The VS Build tools aren't something that surreptitiously sneaks on to your machine in the dead of night, cloaked in darkness and unintended install flags (unlike Candy Crush Saga); I'd hope you'd remember installing them.
If not, there's information on the Install page for Rust (scroll down to "Windows considerations").
I've seen this happen even when MSVC build tools are installed. My solution is to just go to the cygwin/msys folder and rename "link.exe" there to something else such as "link-dont-mess-up-my-system-path-please.exe".
Actually, that brings up an excellent point: MSYS' linkshould not be on your system PATH: it's for linking "MSYS executables", not normal Windows executables.
I assume it's been put on PATH; I can't think how else Rust managed to find it.
link in MSYS isn't even a linker. It's used to create hard links. Regardless Rust will not invoke link.exe from PATHunless it is unable to locate all necessary VC++ components itself, in which case you most likely are missing some vital VC++ component like the Windows SDK.
I've checked if i installed or not C++ building tools, and i didn't. 6.5 GB of download... ok, rust windows can wait a few months, let's use WSL. (Also, any reference link to cross building? (WSL ubuntu 18.4 -> W10 exe))
My current problem is that i can't install the rust extension on vscode (installed on windows) having rust on WSL.
The problem is that vscode will run on Windows, and therefore depend on Windows rust, and windows rust utilities, which includes rustup. So if you want to use rustup I'm afraid you need the MSVC build tools.