我在 Linux 上使用 freeglut 在 C++ (g++) 中编写了一些效果,并使用
I have written some effects in C++ (g++) using freeglut on Linux, and I compile them with
g++ -Wall -lglut part8.cpp -o part8
所以我想知道是否有可能让 g++ 生成包含所需一切的静态编译 Windows 可执行文件?
So I was wondering if it is possible to have g++ make static compiled Windows executables that contains everything needed?
我没有 Windows,所以如果我能在 Linux 上做到这一点,那就太酷了 :)
I don't have Windows, so it would be really cool, if I could do that on Linux :)
mingw32 作为 Linux 的一个包存在.您可以使用它交叉编译和链接 Windows 应用程序.在 Code::Blocks 论坛上有一个教程.例如,请注意命令更改为 x86_64-w64-mingw32-gcc-win32.
mingw32 exists as a package for Linux. You can cross-compile and -link Windows applications with it. There's a tutorial here at the Code::Blocks forum. Mind that the command changes to x86_64-w64-mingw32-gcc-win32, for example.
例如,Ubuntu 的存储库中有 MinGW:
Ubuntu, for example, has MinGW in its repositories:
$ apt-cache search mingw
[...]
g++-mingw-w64 - GNU C++ compiler for MinGW-w64
gcc-mingw-w64 - GNU C compiler for MinGW-w64
mingw-w64 - Development environment targeting 32- and 64-bit Windows
[...]
这篇关于如何使用 gcc/g++ 在 Linux 上为 Windows 编译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
fpermissive 标志有什么作用?What does the fpermissive flag do?(fpermissive 标志有什么作用?)
如何在我不想编辑的第 3 方代码中禁用来自 gccHow do you disable the unused variable warnings coming out of gcc in 3rd party code I do not wish to edit?(如何在我不想编辑的第 3 方代码中禁
使用 GCC 预编译头文件Precompiled headers with GCC(使用 GCC 预编译头文件)
如何在 OS X 中包含 omp.h?How to include omp.h in OS X?(如何在 OS X 中包含 omp.h?)
如何让 GCC 将 .text 部分编译为可写在 ELF 二进制文How can I make GCC compile the .text section as writable in an ELF binary?(如何让 GCC 将 .text 部分编译为可写在 ELF 二进制文件中?)
GCC、字符串化和内联 GLSL?GCC, stringification, and inline GLSL?(GCC、字符串化和内联 GLSL?)