rustup target add x86_64-pc-windows-msvc
cargo build --target x86_64-pc-windows-msvc
error: linker `link.exe` not found
|
= note: No such file or directory (os error 2)
note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that VS 2013 or VS 2015 was installed with the Visual C++ option
error: aborting due to previous error
error: Could not compile `test_rust`.
To learn more, run the command again with --verbose.
can't found link.exe, Is there anything else needs to be installed?
You cannot target the MSVC toolchain from linux unless you can manage to get a working version of the microsoft linker (link.exe) and any required runtime libraries. It's plausible you could use the clang linker for this, but you're essentially on your own with this path.
What you probably want is to target the -gnu triple instead.
Also, this is a good source of information about cross compiling with rust: https://github.com/japaric/rust-cross
thanks for reply~
Most helpful comment
You cannot target the MSVC toolchain from linux unless you can manage to get a working version of the microsoft linker (link.exe) and any required runtime libraries. It's plausible you could use the clang linker for this, but you're essentially on your own with this path.
What you probably want is to target the -gnu triple instead.
Also, this is a good source of information about cross compiling with rust: https://github.com/japaric/rust-cross