Fix missing Windows.h: require full mingw-w64 package, not just compiler
gcc-mingw-w64-x86-64 on Debian/Ubuntu ships only the compiler binary, without Windows API headers — causing fatal error: Windows.h not found. The fix is to install the mingw-w64 meta-package which includes headers, CRT and runtime libraries. Added a check-tools probe that compiles #include <windows.h> and prints a clear error with the correct package name if headers are missing. Updated README with a warning about the incomplete package. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f29970542b
commit
90c906eb3a
@ -9,9 +9,9 @@
|
||||
# make -f Makefile.windows distclean # + удалить собранный и скачанный FFTW
|
||||
#
|
||||
# Зависимости (установить до запуска):
|
||||
# Arch: sudo pacman -S mingw-w64-gcc
|
||||
# Debian: sudo apt install gcc-mingw-w64-x86-64 binutils-mingw-w64-x86-64
|
||||
# Fedora: sudo dnf install mingw64-gcc mingw64-binutils
|
||||
# Arch: sudo pacman -S mingw-w64-gcc (тянет mingw-w64-headers автоматически)
|
||||
# Debian: sudo apt install mingw-w64 (мета-пакет: компилятор + заголовки + CRT)
|
||||
# Fedora: sudo dnf install mingw64-gcc (тянет mingw64-headers автоматически)
|
||||
# + wget или curl, tar
|
||||
#
|
||||
|
||||
@ -114,9 +114,17 @@ check-tools:
|
||||
echo ""; \
|
||||
echo "ОШИБКА: $(CC) не найден. Установите mingw-w64:"; \
|
||||
echo " Arch: sudo pacman -S mingw-w64-gcc"; \
|
||||
echo " Debian: sudo apt install gcc-mingw-w64-x86-64"; \
|
||||
echo " Debian: sudo apt install mingw-w64"; \
|
||||
echo " Fedora: sudo dnf install mingw64-gcc"; \
|
||||
echo ""; exit 1; }
|
||||
@echo '#include <windows.h>' | $(CC) -x c - -fsyntax-only 2>/dev/null || { \
|
||||
echo ""; \
|
||||
echo "ОШИБКА: Windows API заголовки не найдены."; \
|
||||
echo "Установите пакет с заголовками MinGW-w64:"; \
|
||||
echo " Arch: sudo pacman -S mingw-w64-headers"; \
|
||||
echo " Debian: sudo apt install mingw-w64 # не gcc-mingw-w64-x86-64!"; \
|
||||
echo " Fedora: sudo dnf install mingw64-headers"; \
|
||||
echo ""; exit 1; }
|
||||
@(command -v wget >/dev/null 2>&1 || command -v curl >/dev/null 2>&1) || { \
|
||||
echo "ОШИБКА: требуется wget или curl"; exit 1; }
|
||||
|
||||
|
||||
10
README.md
10
README.md
@ -93,17 +93,19 @@ make clean
|
||||
|
||||
```bash
|
||||
# Arch
|
||||
sudo pacman -S mingw-w64-gcc
|
||||
sudo pacman -S mingw-w64-gcc # тянет mingw-w64-headers автоматически
|
||||
|
||||
# Debian / Ubuntu
|
||||
sudo apt install gcc-mingw-w64-x86-64 binutils-mingw-w64-x86-64
|
||||
# Debian / Ubuntu — нужен мета-пакет mingw-w64, а не только компилятор
|
||||
sudo apt install mingw-w64
|
||||
|
||||
# Fedora
|
||||
sudo dnf install mingw64-gcc mingw64-binutils
|
||||
sudo dnf install mingw64-gcc # тянет mingw64-headers автоматически
|
||||
```
|
||||
|
||||
Также нужен `wget` или `curl`.
|
||||
|
||||
> **Debian/Ubuntu:** пакет `gcc-mingw-w64-x86-64` содержит только компилятор без Windows API заголовков — `Windows.h` не будет найден. Используйте `mingw-w64`.
|
||||
|
||||
### Сборка
|
||||
|
||||
```bash
|
||||
|
||||
Loading…
Reference in New Issue
Block a user