Files
dcr/docs-crowdin-export/ru-RU/docs/recipes/cross-to-windows.mdx.mdx
2026-07-06 02:21:26 +08:00

48 lines
805 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
sidebar_label: Кросс-компиляция для Windows
---
# Кросс-компиляция для Windows на Linux
Сборка Windows-бинаря на Linux с использованием mingw-w64.
## Установка toolchain
```bash
# Ubuntu/Debian
sudo apt install mingw-w64
# Fedora
sudo dnf install mingw64-gcc mingw64-binutils
```
## Конфигурация
```toml
[package]
name = "my-app"
version = "0.1.0"
type = "app"
[build]
language = "c"
standard = "c17"
target = "windows"
```
## Сборка
```bash
dcr build --target windows --release
```
Артефакт: `target/x86_64-pc-windows-gnu/release/my-app.exe`.
## Кастомный toolchain (опционально)
```toml
[toolchain]
cc = "x86_64-w64-mingw32-gcc"
cxx = "x86_64-w64-mingw32-g++"
```