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

windows support needed to select subsystem for compilation #2986

Closed
metajack opened this issue Aug 12, 2016 · 7 comments
Closed

windows support needed to select subsystem for compilation #2986

metajack opened this issue Aug 12, 2016 · 7 comments

Comments

@metajack
Copy link

Currently rustc seems to default to the console subsystem on windows (both for gnu and msvc builds). There should be some way to set this in Cargo.toml so that the correct subsystem is used.

Here are the known ways to deal with this currently, all of which suck:

  1. After cargo builds a console subsystem app, if you want a windows subsystem one, run editbin.exe manually or as part of some higher level build script like mach.
  2. Override the linker with fake one that runs editbin.exe on the executable and swaps the subsystem. This solution won't work if your link command is not a real compiled executable because the link command line might be too long due to windows command line argument limitations.
  3. Set RUSTFLAGS="-C link-args=-Wl,--subsystem,windows" or whatever subsystem you want. Unfortunately this causes Cargo to link every executable with the windows subsystem. In particular this means all build scripts get compiled this way which means they pop up console windows constantly during the build process.
@metajack
Copy link
Author

@alexcrichton
Copy link
Member

I think this is just rust-lang/rfcs#1665?

@alexcrichton
Copy link
Member

Or rather, a concern that should be addressed as part of that RFC.

@denisbider
Copy link

OK guys. I'm a Windows developer who's looking into picking up Rust because of its safety advantages over C/C++.

The very first thing I need is to be able to target the Windows subsystem. I need to be able to target either the console subsystem or the graphical subsystem individually for each binary. That's the very first thing I need in order to use Rust.

Are you saying this is still not implemented at this time...?

@alexcrichton
Copy link
Member

@denisbider this is implemented, it's just not stabilized yet. You can track support at rust-lang/rust#37499

@alexcrichton
Copy link
Member

This was stabilized in rust-lang/rust, so closing.

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

3 participants