我正在尝试使用 64 位 MinGWhttp://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/ http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/但是当我用它编译程序时,当 DLL 不可用时,生成的可执行文件会失败。
如何让这个编译器与标准库进行静态链接?
或者我应该使用另一个 64 位 MinGW 发行版?
g++ 开关应该是
-static
See
http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html.
-static
On systems that support dynamic linking, this prevents linking with
the shared libraries. On other systems, this option has no effect.
您应该发布用于编译/链接的命令行,以便在这对您不起作用时获得更多帮助。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)