Page 1 of 1

Building 32bit wxWidgets libraries with tdm64

Posted: Mon Dec 12, 2016 5:58 am
by New Pagodi
TL/DNR version:
I think it would be possible to build 32 bit libraries with tdm64 if you could pass extra flags to windres. Is there any way to do that with mingw32-make?

Longer version:

Following up on this thread, I was wondering if its possible to make 32bit libraries with tdm64. I tried with the command line:

Code: Select all

mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release CXXFLAGS="-std=gnu++11 -m32" CFLAGS=-m32 LDFLAGS=-m32
and it started to work. It built the ancillary libraries like expat and jpeg and even built libwxbase31u.a. Dumpbin confirms they are 32bit libraries. However, the build process failed when trying to build wxbase310u_gcc_custom.dll with the line:

Code: Select all

i386:x86-64 architecture of input file `gcc_x86_mswudll\basedll_version_rc.o' is incompatible with i386 output
The object file basedll_version_rc.o is built with the command line:

Code: Select all

windres --use-temp-file -i../../src/msw/version.rc -ogcc_x86_mswudll\basedll_version_rc.o  <...a bunch of stuff...>
To make a 32bit object file instead, I just cut and pasted that line and added "--target=pe-i386" to make a true 32bit object file from that resource. Then I reran the mingw32-make. This time, It did manage to build wxbase310u_gcc_custom.dll, but it quickly ran ran into the same problem trying to make wxbase310u_net_gcc_custom.dll. I assume it would have the same problem with all of the dlls.

I think if you just added the extra option to windres, it would build the correct object files. But looking at the lines containing "$(WINDRES)" in makefile.gcc, it doesn't look like any of the options are user settable. Am I missing something? Is there a way to pass extra flags to windres similar to the way you can pass extra flags to the compiler and linker?

Re: Building 32bit wxWidgets libraries with tdm64

Posted: Mon Dec 12, 2016 7:24 am
by xaviou
Hi
New Pagodi wrote:TL/DNR version:
I think it would be possible to build 32 bit libraries with tdm64 if you could pass extra flags to windres. Is there any way to do that with mingw32-make?
Yes, it is

Here his the full command line I use for this :

Code: Select all

mingw32-make.exe -f makefile.gcc BUILD=release CPP="gcc -E -D_M_IX86 -m32" LDFLAGS="-m32" CPPFLAGS="-m32" WINDRES="windres --use-temp-file -F pe-i386"  UNICODE=1 SHARED=1 CXXFLAGS="-m32 -fno-keep-inline-dllexport -std=gnu++11" 
Regards
Xav'

Re: Building 32bit wxWidgets libraries with tdm64

Posted: Mon Dec 12, 2016 7:45 am
by New Pagodi
Awesome! Thanks.