TDM-GCC w64 script to change windres for 32bit?

4.3k views Asked by At

Trying to get the TDM-GCC(4.7.1) running on XP SP3 - I just need a c++ 32bit build for now. It seems that windres is not in the right format, my .rc file is failing the build:

x86_64-w64-mingw32-g++.exe  -Wall -m32 -s -D_M_X86 -DBUILD_DLL -DNDEBUG     -c C:\SynthEditSDK\TD_SV\SV.cpp -o obj\Release\TD_SV\SV.o
windres.exe  -J rc -O coff -i C:\SYNTHE~1\TD_SV\TD_SV.rc -o obj\Release\TD_SV\TD_SV.res
x86_64-w64-mingw32-g++.exe -shared -Wl,--output-def=bin\Release\libTD_SV -Wl,--out-implib=bin\Release\libTD_SV -Wl,--dll  obj\Release\se_sdk3\mp_sdk_audio.o obj\Release\se_sdk3\mp_sdk_common.o obj\Release\TD_SV\SV.o  obj\Release\TD_SV\TD_SV.res  -o bin\Release\TD_SV.sem -Wl,--kill-at  -static-libgcc -m32  -luser32 
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/bin/ld.exe: i386:x86-64 architecture of input file `obj\Release\TD_SV\TD_SV.res' is incompatible with i386 output
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 2 seconds)
0 errors, 2 warnings (0 minutes, 2 seconds)

My resource file(TD_SV.rc) seems to be the error:

TD_SV.res' is incompatible with i386 output

I've been googling for hours and the closest I got to a solution is here:

http://backyardcode.com/

He suggests this script - but I can't figure out how to change it to suit my needs - Any help appreciated!

$rescomp [[ if(GetProjectManager().GetActiveProject().GetActiveBuildTarget().Matches(_T("Debug32")) || GetProjectManager().GetActiveProject().GetActiveBuildTarget().Matches(_T("Release32"))) { print(_T("-D USE_X86_MODE -F pe-i386")); } ]] -i $file -J rc -o $resource_output -O coff $res_includes

Also - is there any TDM-GCC (pre-built/installer type) alternatives? All I really need is 32bit build with graphite options. Also using CodeBlocks IDE.

Regards Andrew

1

There are 1 answers

1
Iron Bug On BEST ANSWER

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" ........