系统相关
首页 > 系统相关> > Unable to compile Rust hello world on Windows: linker link.exe not found

Unable to compile Rust hello world on Windows: linker link.exe not found

作者:互联网

cargo build报错 

 1 Compiling helloworld v0.1.0 (C:\Users\DELL\helloworld)
 2 
 3 error: linker `link.exe` not found
 4 note: The system cannot find the file specified. (os error 2)
 5 note: the msvc targets depend on the msvc linker but `link.exe` was not found
 6 note: please ensure that VS 2013, VS 2015 or VS 2017 was installed with the Visual C++ option
 7 error: aborting due to previous error
 8 error: Could not compile `helloworld`.
 9 
10 To learn more, run the command again with --verbose.

 

解决:

  1. rustup toolchain install stable-x86_64-pc-windows-gnu

     

  2. rustup default stable-x86_64-pc-windows-gnu

     

结果:

  

PS E:\rust\hello_world> cargo build
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s

 

标签:exe,Windows,linker,note,VS,link,error
来源: https://www.cnblogs.com/sliverf/p/16361665.html