std::process::Command creates a cmd.exe window when run from a C library

I have a Qt application that links a Rust library built as a C library. In this case, Command shows a cmd.exe window. But if I execute the same Rust code from a Rust binary - there are no console. Also, if I run the same command via QProcess there is also no console.

Here is a minimal example: https://github.com/RazrFalcon/rust-cmd-bug

The GUI app has two buttons: one runs the Rust code and console shows up, other uses QProcess and there are no console.

Is it a known bug? I've tried using #![windows_subsystem = "windows"], but it has no effect (probably because I'm building a library).

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.