How to create wxWidgets program for Windows 32 bit using codeblocks-20.03mingw?

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
tap1956
Earned a small fee
Earned a small fee
Posts: 11
Joined: Thu Mar 05, 2020 8:05 pm

How to create wxWidgets program for Windows 32 bit using codeblocks-20.03mingw?

Post by tap1956 »

I installed codeblocks-20.03mingw-setup on Windows 10 Home 64bit. I compiled wxWidgets with the commands:
mingw32-make -f makefile.gcc SHARED = 0 UNICODE = 1 BUILD = debug
mingw32-make -f makefile.gcc SHARED = 0 UNICODE = 1 BUILD = release
Then I released a version of the program with wxWidgets. With the m64 flag set, I was able to create different versions of the program (with the Static linking flag set and three static flags set. The program works fine in Windows 64 bit. When the m32 flag is set, errors occur (indicated only part of the errors):

Code: Select all

-windres.exe -ID: \ wxWid \ include -ID: \ wxWid \ lib \ gcc_lib \ mswu -J rc -O coff -i D: \ MyProgramming \ wxTestNew \ resource.rc -o obj \ Release \ resource.res
g ++. exe -Wall -m32 -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -O2 -m32 -ID: \ wxWid \ include -ID: \ wxWid \ lib \ gcc_lib \ mswu -ID: \ wxWid \ lib \ gcc_ -ID: \ wxWid \ include -c D: \ MyProgramming \ wxTestNew \ wxTestNewApp.cpp -o obj \ Release \ wxTestNewApp.o
g ++. exe -Wall -m32 -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -O2 -m32 -ID: \ wxWid \ include -ID: \ wxWid \ lib \ gcc_lib \ mswu -ID: \ wxWid \ lib \ gcc_ -ID: \ wxWid \ include -c D: \ MyProgramming \ wxTestNew \ wxTestNewMain.cpp -o obj \ Release \ wxTestNewMain.o
g ++. exe -LD: \ wxWid \ lib \ gcc_lib -o bin \ Release \ wxTestNew.exe obj \ Release \ wxTestNewApp.o obj \ Release \ wxTestNewMain.o obj \ Release \ resource.res -s -m32 -m32 -mthreads -lwxmsw31u_core -lwxbase31u -lwxpng -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32llol -lllxlllclllclllcdlll -mwindows
D: / Program Files / CodeBlocks / MinGW / bin /../ lib / gcc / x86_64-w64-mingw32 / 8.1.0 /../../../../ x86_64-w64-mingw32 / bin / ld .exe: skipping incompatible D: \ wxWid \ lib \ gcc_lib / libwxmsw31u_core.a when searching for -lwxmsw31u_core
D: / Program Files / CodeBlocks / MinGW / bin /../ lib / gcc / x86_64-w64-mingw32 / 8.1.0 /../../../../ x86_64-w64-mingw32 / bin / ld .exe: skipping incompatible D: \ wxWid \ lib \ gcc_lib \ libwxmsw31u_core.a when searching for -lwxmsw31u_core
D: / Program Files / CodeBlocks / MinGW / bin /../ lib / gcc / x86_64-w64-mingw32 / 8.1.0 /../../../../ x86_64-w64-mingw32 / bin / ld .exe: skipping incompatible D: \ wxWid \ lib \ gcc_lib / libwxmsw31u_core.a when searching for -lwxmsw31u_core
D: / Program Files / CodeBlocks / MinGW / bin /../ lib / gcc / x86_64-w64-mingw32 / 8.1.0 /../../../../ x86_64-w64-mingw32 / bin / ld .exe: cannot find -lwxmsw31u_core
What needs to be done so that on a PC with Windows 64 bit and codeblocks-20.03mingw it is possible to create programs for a PC with Windows 32 bits?
wxTestNew.zip
(13.09 KiB) Downloaded 92 times
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: How to create wxWidgets program for Windows 32 bit using codeblocks-20.03mingw?

Post by PB »

Did you also build required wxWidgets configurations in 32-bit mode and pointed the linker to them instead of 64-bit ones?

I am not very familiar with mingw so I am not even sure if its x86_64 version can produce i686 binaries. I use separate build tools (e.g., i686-8.1.0-win32-sjlj-rt_v6-rev0 vs x86_64-8.1.0-win32-seh-rt_v6-rev0), Code::Blocks make it easy to set up and use multiple compilers...
tap1956
Earned a small fee
Earned a small fee
Posts: 11
Joined: Thu Mar 05, 2020 8:05 pm

Re: How to create wxWidgets program for Windows 32 bit using codeblocks-20.03mingw?

Post by tap1956 »

Thanks a lot. I understood.
Post Reply