I'm a BSD and Linux user.
I sometimes wanted to share my source code with people who are using Windows, so they can compile my programs. It turned out that installing Rust was a hassle for them.
When I visit Install Rust - Rust Programming Language, then it shows me:
It looks like you’re running macOS, Linux, or another Unix-like OS. To download Rustup and install Rust, run the following in your terminal, then follow the on-screen instructions. See "Other Installation Methods" if you are on Windows.
Not sure what people on Windows see.
Clicking on that link (Other Installation Methods), I can get to rustup-init.exe
, but after installing Rust, programs won't compile because link.exe
isn't found. So I had to search again (did it in past, but I forgot) to figure out there needs to be a linker installed.
But which linker to install? Microsoft has some recommendations:
Install Visual Studio (recommended) or the Microsoft C++ Build Tools
I wanted to let a friend compile a small program for amateur radio, and not have them install a full Visual Studio! Just these dependencies:
[dependencies]
rustyline = "9.1.2"
reqwest = { version = "0.11.10", features = ["blocking"] }
clap = { version = "3.1.18", features = ["derive"] }
So I told them to go for Microsoft C++ Build Tools (after trying with x86_64-w64-mingw32-gcc
, which didn't work because of some linker error (don't have the error message anymore).
Trying to install Microsoft C++ Build Tools, there are hundreds of components to pick from? Is it really necessary to install everything? I asked them to install only what sounded to be needed for linking the program, but then:
ld: cannot find -lntdll
Not sure if it was because I didn't install everything or because of a previous try to get x86_64-w64-mingw32-gcc
working.
My point is:
Why isn't there a short accessible documentation what to do to get Rust working on Windows without installing a lot of stuff that'ts not needed? Or maybe there exists one and I just didn't find it? Or I can't see it when I'm browsing with Linux, BSD, or Android?
Perhaps someone here can help me out:
- What to do to get a Rust compiler and linker running on Windows (without installing lots of stuff that's not needed)?
- What is that
ntdll
and what to do to install it? - Why is Visual Studio recommended? Is it bad to not install it?
- Where to find good documentation on it when I would like to help other people installing Rust on Windows?
Your help is very much appreciated, and please forgive me my frustrated tone .