繁体   English   中英

wxWidgets交叉编译 - 错误:数组'_GStaticAssertCompileTimeAssertion_0'的大小为负数

[英]wxWidgets cross-compile - error: size of array ‘_GStaticAssertCompileTimeAssertion_0’ is negative

我试图在64位Linux机器上为32位Linux编译静态wxWidgets 3.1库。

我的配置如下:

../configure "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32" --host=i686-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-shared --enable-unicode
make

该库开始构建,但在中途我收到此错误:

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

我注意到错误提到了glib和gtk-2.0。 我错过了这些软件包的变体还是我的配置错了? 我相信我的配置应该是正确的。 我的configure是否有特殊的wxWidgets特定选项?

在寻找答案之后,似乎在64位Linux上对32位Linux进行交叉编译的最佳方法是使用chroot构建环境。 这显然是许多开发人员所做的。

Github上有一些很好的说明。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM