码迷,mamicode.com
首页 > Windows程序 > 详细

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

时间:2014-11-05 19:44:18      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:mingw   windres   tdm   64   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位程序会崩溃.

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

标签:mingw   windres   tdm   64   32   

原文地址:http://blog.csdn.net/infoworld/article/details/40827861

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!