我正在按照下面的指南构建一个 mingw-w64 工具链来交叉编译Fedora 26上的windows64 . (我不能使用buildin工具链,因为Fedora人员决定激活我想要禁用的某些编译器选项 . )

http://pete.akeo.ie/2010/07/compiling-mingw-w64-with-multilib-on.html

我知道它不是最新的,但所有步骤看起来都合理且与版本无关 .

所以现在这是我的问题:当我尝试执行最后一次gcc构建 "Gcc, pass 2" 时,出现以下错误消息:

<path to build dir>/mingw-w64/build/gcc/./gcc/xgcc -B<path to build dir>/mingw-w64/build/gcc/./gcc/ -L<path to local install dir>/mingw-local/x86_64-w64-mingw32/lib -L<path to local install dir>/mingw-local/mingw/lib -isystem <path to local install dir>/mingw-local/x86_64-w64-mingw32/include -isystem <path to local install dir>/mingw-local/mingw/include -B<path to local install dir>/mingw-local/x86_64-w64-mingw32/bin/ -B<path to local install dir>/mingw-local/x86_64-w64-mingw32/lib/ -isystem <path to local install dir>/mingw-local/x86_64-w64-mingw32/include -isystem <path to local install dir>/mingw-local/x86_64-w64-mingw32/sys-include    -g -O2 -m32 -O2 -I../../../../../gcc-7.2.0/libgcc/../winsup/w32api/include -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -I. -I. -I../../.././gcc -I../../../../../gcc-7.2.0/libgcc -I../../../../../gcc-7.2.0/libgcc/. -I../../../../../gcc-7.2.0/libgcc/../gcc -I../../../../../gcc-7.2.0/libgcc/../include  -DHAVE_CC_TLS -DUSE_EMUTLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../../../../../gcc-7.2.0/libgcc/libgcc2.c 

In file included from ../../../../../gcc-7.2.0/libgcc/../gcc/tsystem.h:44:0,
             from ../../../../../gcc-7.2.0/libgcc/libgcc2.c:27:
<path to build dir>/mingw-w64/build/gcc/gcc/include/stddef.h:1:15: fatal error: stddef.h: No such file or directory
#include_next <stddef.h>
           ^~~~~~~~~~
compilation terminated.

我正在使用以下版本号:

  • binutils-2.29

  • gcc-7.2.0

  • gmp-6.1.2

  • mingw-w64-v5.0.3

  • mpc-1.1.0

  • mpfr-4.0.0

Fedora自己的gcc也是版本7.2.1,我无法从gnu.org下载 . (无论如何我提到它,因为我发现提到的一些解决方案可能存在版本冲突 . )

我被困在这里,希望任何人都可以提供帮助 .