[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Problem cross-compiling glib based program



Hi,

after building cross-gcc according to
https://wiki.debian.org/CrossCompiling#Building_your_own_cross-toolchain
I get into the problem below on Debian 9 (testing/stretch).
Any ideas? Thanks in advance!

Cheers

$ echo -e '#include <glib.h>\n\nint main() {\n\treturn 0;\n}' > true.c
$ CC=arm-linux-gnueabi-gcc # or armhf, it does not matter
$ CFLAGS=$(pkg-config --cflags glib-2.0)
$ export CC CFLAGS
$ make true.o
arm-linux-gnueabi-gcc -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -c -o true.o true.c In file included from /usr/lib/x86_64-linux-gnu/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 true.c:1:
/usr/include/glib-2.0/glib/gtypes.h: In function '_GLIB_CHECKED_ADD_U64':
/usr/include/glib-2.0/glib/gmacros.h:232:53: error: size of array '_GStaticAssertCompileTimeAssertion_0' is negative #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
                                                     ^
/usr/include/glib-2.0/glib/gmacros.h:229:47: note: in definition of macro 'G_PASTE_ARGS'
 #define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
                                               ^~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:232:44: note: in expansion of macro 'G_PASTE' #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));
   ^~~~~~~~~~~~~~~
<builtin>: recipe for target 'true.o' failed
make: *** [true.o] Error 1



Reply to: