您的位置:首页 > 其它

[MinGW]_[初级]_[64位的windres如何编译出32位的链接文件]

2014-11-05 18:34 871 查看
场景:

1. MinGW(TDM)出了64位的gcc,4.8.1,64位对编译64位的程序非常友好,但是对编译32位程序就需要做额外的工作了。

2. 比如用windres编译manifest,64位环境下默认是不行的,带configure或makefile的即使加了-m32都不会自动对windres设置为编译32位的。

这里就需要在configure或make增加一些参数了.

./configure RCFLAGS="--output-format=coff --target=pe-i386" ........


make RCFLAGS="--output-format=coff --target=pe-i386" ........


原文地址:

http://stackoverflow.com/questions/18805155/tdm-gcc-w64-script-to-change-windres-for-32bit

To see all possble windres parameters, you can request help:

    x86_64-w64-mingw32-windres.exe --help

For Windows 32 bit format you need coff format with pe-i386 target.

Basically, you have to add -F pe-i386 (or --target=pe-i386) after -O coff flag to your command line if you generate it manually.

In GNU autotools it's about the RCFLAGS. So if there's some configure script, just add

    ./configure RCFLAGS="--output-format=coff --target=pe-i386" ........


注意: 顺便说下4.8.1的64位gdb在debug编译的32位程序会崩溃.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐