Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't cross-compiling x86_64-pc-windows-msvc in ubuntu #1470

Closed
fcying opened this issue Jul 22, 2018 · 2 comments
Closed

can't cross-compiling x86_64-pc-windows-msvc in ubuntu #1470

fcying opened this issue Jul 22, 2018 · 2 comments

Comments

@fcying
Copy link

fcying commented Jul 22, 2018

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?

@Diggsey
Copy link
Contributor

Diggsey commented Jul 28, 2018

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

@Diggsey Diggsey closed this as completed Jul 28, 2018
@fcying
Copy link
Author

fcying commented Jul 28, 2018

thanks for reply~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants