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

cross build --target x86_64-pc-windows-msvc => error: linker link.exe not found #238

Closed
theronic opened this issue Dec 6, 2018 · 7 comments

Comments

@theronic
Copy link

theronic commented Dec 6, 2018

Compiling for Windows on OSX seems to require non-zero configuration :).

@PaulRBerg
Copy link

Indeed. I am getting the following error log on [email protected] and [email protected]:

error[E0463]: can't find crate for `core`
  |
  = note: the `x86_64-pc-windows-msvc` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `lazy_static`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `core`
  |
  = note: the `x86_64-pc-windows-msvc` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `std`
  |
  = note: the `x86_64-pc-windows-msvc` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `std`
  |
  = note: the `x86_64-pc-windows-msvc` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `std`
  |
  = note: the `x86_64-pc-windows-msvc` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `core`
  |
  = note: the `x86_64-pc-windows-msvc` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `core`
  |
  = note: the `x86_64-pc-windows-msvc` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `std`
  |
  = note: the `x86_64-pc-windows-msvc` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: build failed

@schell
Copy link

schell commented Jan 25, 2021

I'm getting this same error trying to cross build --target x86_64-apple-darwin from aarch64-apple-darwin.

@Alexhuszagh Alexhuszagh added bug A-windows Area: windows targets and removed A-windows Area: windows targets labels May 27, 2022
@Alexhuszagh
Copy link
Contributor

We don't support images for any of those targets, since we cannot distribute images containing MSVC or the macOS SDK. We now warn you if cross falls back to cargo on the host, and we also have Dockerfiles so you can build images to cross-compile for MSVC and Darwin targets.

@andrewbaxter
Copy link

FWIW the warning is the first line of the output and almost immediately gets flushed from the output on a new build by Compiling ... lines.

Just some thoughts:

  1. If someone's cross compiling, is it ever desirable to fall back to the local cargo? Maybe (erring on the side of safety) it should fail immediately instead of proceed, with a flag to try with the local cargo if desired?
  2. Failing that, logging it at the end might make it more visible.
  3. A note up front about windows builds would be great - I came to the readme and saw “Zero setup” cross compilation and “cross testing” of Rust crates and thought "great!", read the getting started steps, and got a build failure. Adding a warning/note about platforms that aren't zero-config prominently in the readme might reduce the surprise of failures and allow people to avoid searching (closed) issues to find the solution.
  4. I also checked the wiki, but there's nothing there about windows/msvc AFAICT. Would having a section there be a better place for this information?

@Emilgardis
Copy link
Member

Just some thoughts:

1. If someone's cross compiling, is it ever desirable to fall back to the local cargo? Maybe (erring on the side of safety) it should fail immediately instead of proceed, with a flag to try with the local cargo if desired?

I agree, see #1591

2. Failing that, logging it at the end might make it more visible.

yes, this would be easy to implement also.

3. A note up front about windows builds would be great - I came to the readme and saw `“Zero setup” cross compilation and “cross testing” of Rust crates` and thought "great!", read the getting started steps, and got a build failure.  Adding a warning/note about platforms that aren't zero-config prominently in the readme might reduce the surprise of failures and allow people to avoid searching (closed) issues to find the solution.
4. I also checked the wiki, but there's nothing there about windows/msvc AFAICT.  Would having a section there be a better place for this information?

The problem here is that the slightly optimistic claim is only for our supported targets, which we list on the README. Maybe we could add a side-note about unsupported targets but seems unneccessary. I'd be open for further discussion and/or PRs improving but this 3 year old issue is probably not the place for it!

@andrewbaxter
Copy link

Oh, #1591 , nice!

Sorry, I searched a bit and thought this was where discussion had ended so I thought this would be the most relevant place. Should I create new issues/discussions for any of them? FWIW I ran into other Windows build issues (not cross related) so I'm kind of exploring other options now, but I keep coming back to Windows builds about once a year so I wanted to open discussion.

@Emilgardis
Copy link
Member

Please do 👍🏼

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

No branches or pull requests

6 participants