windows上做Rust开发编译运行提示:
please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed with the Visual C++ option
StackOverflow 解决方案:
https://stackoverflow.com/questions/55603111/unable-to-compile-rust-hello-world-on-windows-linker-link-exe-not-found
Case 1: Using C++ win compiler, to fix it you need to reinstall VS build tool C++
Download the Visual Studio 2019 Build tools from the Microsoft website: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16
After the download, while installing the Build tools, make sure that you install the required components:
- C++ build tools (这个根本没找到,太难了???)
This will download required files. Once everything is successfully installed, reboot and re-run your rust program and it will compile successfully.
Case2: This error can come from the fact that you use GCC to compile, to fix it (assume that you already have MinGW):
Tape in cmd: (本人最后选择了这个。最方便了)
rustup uninstall toolchain stable-x86_64-pc-windows-msvc
rustup toolchain install stable-x86_64-pc-windows-gnu
(or download rustup-init for the platform of your choice at https://forge.rust-lang.org/infra/other-installation-methods.html)rustup default stable-x86_64-pc-windows-gnu
网友评论