Rustup: can't cross-compiling x86_64-pc-windows-msvc in ubuntu

Created on 22 Jul 2018  路  2Comments  路  Source: rust-lang/rustup

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?

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

All 2 comments

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~

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fenhl picture fenhl  路  4Comments

KasMA1990 picture KasMA1990  路  3Comments

kornelski picture kornelski  路  3Comments

lilred picture lilred  路  3Comments

wezm picture wezm  路  3Comments