Compile 32 bit wxWidgets 3.1 on Linux 64 bit Errors

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
nametable7
In need of some credit
In need of some credit
Posts: 2
Joined: Tue Oct 03, 2017 7:04 pm

Compile 32 bit wxWidgets 3.1 on Linux 64 bit Errors

Post by nametable7 »

I am trying to compile static wxWidgets 3.1 Libraries for 32 bit Linux on a 64 bit Linux machine.

My configuration is the following:

Code: Select all

../configure "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32" --host=i686-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-shared --enable-unicode
make
The library starts to build but then halfway through I get this error:

Code: Select all

In file included from /usr/lib64/glib-2.0/include/glibconfig.h:9:0,
             from /usr/include/glib-2.0/glib/gtypes.h:32,
             from /usr/include/glib-2.0/glib/galloca.h:32,
             from /usr/include/glib-2.0/glib.h:30,
             from /usr/include/glib-2.0/gobject/gbinding.h:28,
             from /usr/include/glib-2.0/glib-object.h:23,
             from /usr/include/glib-2.0/gio/gioenums.h:28,
             from /usr/include/glib-2.0/gio/giotypes.h:28,
             from /usr/include/glib-2.0/gio/gio.h:26,
             from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
             from /usr/include/gtk-2.0/gdk/gdk.h:32,
             from /usr/include/gtk-2.0/gtk/gtk.h:32,
             from ../src/common/utilscmn.cpp:92:
/usr/include/glib-2.0/glib/gtypes.h: In function ‘gboolean 
_GLIB_CHECKED_ADD_U64(guint64*, guint64, guint64)’:
/usr/include/glib-2.0/glib/gmacros.h:142:29: error: size of array ‘_GStaticAssertCompileTimeAssertion_0’ is negative
   __attribute__((__unused__))
                         ^
/usr/include/glib-2.0/glib/gmacros.h:232:120: note: in expansion of 
macro ‘G_GNUC_UNUSED’
#define G_STATIC_ASSERT(expr) typedef char G_PASTE 
(_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] 
G_GNUC_UNUSED

^~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gtypes.h:423:3: note: in expansion of macro 
‘G_STATIC_ASSERT’
   G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64));
   ^~~~~~~~~~~~~~~
make: *** [Makefile:29632: corelib_utilscmn.o] Error 1
I notice that the error mentions glib and gtk-2.0. Am I missing a variant of these packages or is my configuration wrong? I believe that my configuration should be correct. Is there special wxWidgets specific options that I am missing in my configure?

I copied my question from stackoverflow where I originally posted it. https://stackoverflow.com/questions/468 ... ssertion-0
User avatar
davalillocm
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Dec 30, 2021 4:16 am

Re: Compile 32 bit wxWidgets 3.1 on Linux 64 bit Errors

Post by davalillocm »

I read in somewhere that the CXXFLAGS must add the GNU c++ standards adds in order to compile well, so you have to put CXXFLAGS="-std=gnu++11 -m32" or something like that depending if it is c++ 11, 17, 20, etc.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Compile 32 bit wxWidgets 3.1 on Linux 64 bit Errors

Post by ONEEYEMAN »

Hi,
Since you have 64-bit OS installed, you have 64-bit libraries on your machine. They were built specifically for your machine as 64-bit.
You need to install 32-bit libraries somewhere and then try to build them again. Or install 32-bit OS (in a VirtualBox) and build the library and your app.

But I'm curious - why do you want to do that. Just build everything as default.

Thank you.
Post Reply