Getting a 32/64bit lib only with a 32/64bit compiler/linker respectively

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
dbi2022
In need of some credit
In need of some credit
Posts: 8
Joined: Wed Jan 12, 2022 8:25 am

Getting a 32/64bit lib only with a 32/64bit compiler/linker respectively

Post by dbi2022 »

Hi!

I am having issues trying to compile 32bit a WxWidgets shared lib with a 64bit compiler/linker. I just get a 64bit shared lib.
The same for the 64bit shared lib. I get a 32bit shared lib when I try to compile it with a 32bit compiler/linker.

winlibs-gcc-10.3.0
WxWidgets s3.5
Windows 10

with 64bit compiler/linker:
mingw32-make -f makefile.gcc -j 8 BUILD=release SHARED=1 MONOLITHIC=1
and
with 32bit compiler/linker:
mingw32-make -f makefile.gcc -j 8 BUILD=release SHARED=1 MONOLITHIC=1 CFG=64
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: Getting a 32/64bit lib only with a 32/64bit compiler/linker respectively

Post by stahta01 »

You need a real 32 bit toolchain to build an 32 bit C++ library like wxWidgets.

Most, 64bit compiler/linker only has the ability to build simple 32 bit apps; the reason is most of them do not have 32 bit standard libraries.

Tim S.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Getting a 32/64bit lib only with a 32/64bit compiler/linker respectively

Post by ONEEYEMAN »

Hi,
You can try to supply "-m32" and "-" options to your command.
In terms of the command itself:

Since you are on Windows you might need to use SHARED=0 to link wxWidgets statically. That of course doesn't mean the CRT will.
Building shared libraries make sense if you are building the DLL that will be using wxWIdgets.

Using MONOLITHIC=1 will not gain anything. But in turn it might give you issues, especially if you or you client will have multiple libraries installed on their system (like libpng or libsvg), which aere not ABI-compatible.
So, I'd use MONOLITHIC=0. (I almost want to kill the guy who put the YouTube tutorial with this option on).

Thank you.
Post Reply