如何在 64 位 Linux 上为 32 位 Windows 系统从 C 制作 .exe?
上命令:
gcc -m32 app.c -o app.exe
出现错误:
在 app.c:1:0 包含的文件中:
/usr/include/stdio.h:27:10:致命错误:bits/libc-header-start.h:没有这样的文件或目录
#include
^~~~~~~ ~~~~~~~~~~~~~~~~~~~ 编译终止。
如何在 64 位 Linux 上为 32 位 Windows 系统从 C 制作 .exe?
上命令:
gcc -m32 app.c -o app.exe
出现错误:
在 app.c:1:0 包含的文件中:
/usr/include/stdio.h:27:10:致命错误:bits/libc-header-start.h:没有这样的文件或目录
#include
^~~~~~~ ~~~~~~~~~~~~~~~~~~~ 编译终止。
我通过安装命令解决了错误问题:
gcc-multilib但是要为 Linux 上的 Windows 创建一个 .exe,您需要:
gcc,您需要i686-w64-mingw32-gcc为32位 Windows 或64位 Windows调用它x86_64-w64-mingw32-gcc。例如:
i686-w64-mingw32-gcc app.c -o app.exe- 对于 32xx86_64-w64-mingw32-gcc app.c -o app.exe- 64 倍