You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Windows binaries built with the -mwindows linker flag can't have any output to stdout or stderr in them or Windows will instantly terminate the program. I want to have windowed mode binaries for GUI applications, since without the windowed mode flag the binary will spawn a visible console window in addition to the GUI window every time it's run.
Panicing threads seem to cause an unconditional print to stderr. I'm trying to write a panic handler that will pop up a Windows message dialog instead of printing to stdout when the program terminates with a panic, but currently can't do that because windowed mode programs die at the point of the panic and the handler is never reached.
Build it with rustc -C link-args=-mwindows panic.rs. Then run panic.exefrom the Windows explorer. The program terminates and the panic_log.txt file never shows up. (It does seem to work if you run it from the Command Prompt, but end users will be clicking an icon.)
The text was updated successfully, but these errors were encountered:
The linked issues by @nagisa, @Diggsey, and @retep998 I believe all cover our bases pretty well here, so I'm going to close this as a dupe of them. Thanks regardless for the report though!
Windows binaries built with the
-mwindows
linker flag can't have any output to stdout or stderr in them or Windows will instantly terminate the program. I want to have windowed mode binaries for GUI applications, since without the windowed mode flag the binary will spawn a visible console window in addition to the GUI window every time it's run.Panicing threads seem to cause an unconditional print to stderr. I'm trying to write a panic handler that will pop up a Windows message dialog instead of printing to stdout when the program terminates with a panic, but currently can't do that because windowed mode programs die at the point of the panic and the handler is never reached.
To test this, write
panic.rs
:Build it with
rustc -C link-args=-mwindows panic.rs
. Then runpanic.exe
from the Windows explorer. The program terminates and thepanic_log.txt
file never shows up. (It does seem to work if you run it from the Command Prompt, but end users will be clicking an icon.)The text was updated successfully, but these errors were encountered: