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


场景:

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位程序会崩溃.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Peter(阿斯拉达)

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值