---
title: "Windows"
description: "Windows Platform Guide"
---
import { Tabs, TabItem } from '@astrojs/starlight/components';

We test Slint on these Windows versions and architectures:

| Operating System | Architecture    |
| ---------------- | --------------- |
| Windows 10       | x86-64          |
| Windows 11       | x86-64, aarch64 |

## Handle the Console Window

When you run an application, a console window is displayed by [default](https://learn.microsoft.com/en-us/cpp/build/reference/subsystem-specify-subsystem?view=msvc-170).

To disable the console, specify `WINDOWS` as a subsystem.

When you run the application from the command line, if the subsystem is set to `WINDOWS`, it will no longer output `stdout`. If you need `stdout`, consider using `FreeConsole()`.

For more details, see [#3235](https://github.com/slint-ui/slint/issues/3235).

<Tabs syncKey="dev-language">
<TabItem label="Rust" icon="seti:rust">

Add the code to the top of the .rs file which contains `fn main()`:

```rust
#![windows_subsystem = "windows"]
```

If you want to keep console output in debug mode:

```rust
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
```
</TabItem>
<TabItem label="C++" icon="seti:cpp">


Select the `WINDOWS` subsystem by setting the [`WIN32_EXECUTABLE`](https://cmake.org/cmake/help/latest/prop_tgt/WIN32_EXECUTABLE.html#prop_tgt:WIN32_EXECUTABLE) target property on your executable target:

```cmake
add_executable(my_program ...)
set_property(TARGET my_program APPEND PROPERTY WIN32_EXECUTABLE TRUE)
```

</TabItem>

<TabItem label="Python" icon="seti:python">
Change the extension of your Python script from `.py` to `.pyw`. The default Python interpreter associated with
Python files then launches without a console window. Alternatively, use `pythonw.exe` instead of `python.exe` to launch
your Python script.
</TabItem>

</Tabs>

## Rust: Stack Overflows

When developing Rust applications on Windows, you might sooner or later observe the program aborting with `STATUS_STACK_OVERFLOW`,
especially in debug builds. This is a known issue that's a combination of a high demand for stack space and MSVC defaulting to
a stack size for the main thread that's significantly smaller compared to other operating systems.

You can fix this by configuring the linker. Create a [`.cargo\config.toml`](https://doc.rust-lang.org/cargo/reference/config.html#configuration)
file in your project (note the `.cargo` sub-directory) with the following contents:

```toml
[target.x86_64-pc-windows-msvc]
# Increase default stack size to avoid running out of stack
# space in debug builds. The size matches Linux's default.
rustflags = ["-C", "link-arg=/STACK:8000000"]
[target.aarch64-pc-windows-msvc]
# Increase default stack size to avoid running out of stack
# space in debug builds. The size matches Linux's default.
rustflags = ["-C", "link-arg=/STACK:8000000"]
```