场景:
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://*.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位程序会崩溃.