Windows Rust compiler not using mingw as linker

on my windows 10 Rustc works only if i:

  1. install MS VS build tools and specify in path that loooooong path to linker. gcc linker doesnt wor work with rustc, it dont want to see it.
  2. install WIndows SDK.
    No variants - only with these two guys installed.

Even with rustup default windows-gnu?

i install with complete rust setup options, but i get message "warning: Force-skipping unavailable component 'miri-x86_64-pc-windows-msvc'"
i have msys2 with gcc toolchain installed and working.
after that all rustc DONT WANT TO COMPILE, only after MS VS Build tools and WINDOWS SDK installed. how many times again should i repeat it here. i dont know how you all compile with mingw and rustc, it is not working on my computer.

Please try the command I've provided in the previous post. If it fails, please post the output here, surrounded by backticks,

``` 
like this
```

so that it is readable.

output is: error: toolchain 'windows-gnu' is not installed
i have msys2 with gcc toolchain, so what is this another windows-gnu?

OK, sorry, I forgot that rustup default does not try to install the toolchain. First rustup toolchain add windows-gnu, so that you have everything necessary for Rust to use the MinGW tooling (such as pre-build std); after that rustup default windows-gnu. After that all should work as it works with MSVC.

i just now have tried, but got:
warning: downloading with complete profile isn't recommended unless you are a developer of the rust language
what is that?

It means that before, during installation or configuration, you selected a complete rustup profile, which pulls in not only necessary basics (like std) and commonly used tools (like clippy), but also something that is rarely necessary in real work (like sources of rustc itself). In general, it should be no problem to use default profile (by executing rustup set profile default) and install any components not included in it separately. However, if there's only a warning and no errors, looks like your installation had succeeded.

no, when i installed rust, i had chosen complete setup and stable type.
this warning ends the action, nothing goes on, after that add command this warning appears and everything stops and i get again prompt >
i dont know what is going on, but nothing you write is working for me.

and when i made your set default command and tried again add command i got:
error: invalid toolchain name: 'windows-gnu'

rustup toolchain add stable-x86_64-pc-windows-gnu.

What happens when you use these three commands:

rustup set profile default
rustup toolchain install stable-gnu
rustup default stable-gnu

tusen takk, Björn, naa det er alt godt med det
her er screenshot http://voidmain.site/scr_rust01.png

thank you , now it is working, here is screenshot http://voidmain.site/scr_rust01.png
tell me please where i can find these commands on Rust web page????

bjorn3 and chrisd wrote me other commands and that worked, screenshot http://voidmain.site/scr_rust01.png
tell me please where i can find these commands on Rust web page??

rustup set profile default
(rustup toolchain add stable-x86_64-pc-windows-gnu)
rustup toolchain install stable-gnu
rustup default stable-gnu

On Rust web page directly - AFAIK nowhere. It's supposed that you'll read the documentation on the tool you're using, and for rustup there's enough info in the repository README. But the Rust language is not strictly tied to rustup.