I installed Visual Code 2019 and then its rust component. Afterward I rustc hello.rs and got link.exe not found error. Then I saw a post saying needing to install Windows SDK. So I installed Windows SDK (latest version, but My OS is Windows 10 Home) Now I still get the link.exe not found error when I rustc hello.rs. How can I fix this problem? PATH issue?....
Did you restart windows console where observing the error, after all the installations? to update the environment variables etc.
Plus, when installing Visual Studio (NOT Visual Studio Code ), had the option to include build tools been included?
In the Windows Visual Studio Installer, make sure you tick the "Desktop Development with C++" workload. As of Visual Studio 2022, this should install everything you need.
I rebooted Windows. I installed Visual CPP Build Tools. I am not sure I installed Visual Studio because it is not in the instructions I read. I will check on that.
This is a lot more complicated than I expect.
Yeah, it's not ideal. Rustup (the rust installer) hopes to find ways to improve this in the future.
In the meantime, try opening up powershell and copy-paste the following:
&"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer" install --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.CoreBuildTools --add Microsoft.VisualStud
io.Component.Windows11SDK.22000 --productId Microsoft.VisualStudio.Product.Community --channelId VisualStudio.17.Release
This should ensure you have everything that Rust needs.
Thank you very much. I am installing Visual Studio. Should work afterwards.
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.