Re: Problem cross-compiling glib based program
On Thu, Nov 24, 2016 at 07:05:03PM +0100, W. Martin Borgert wrote:
> $ 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)
This sounds wrong. You combine an arm-linux-gnueabi compiler with a
build architecture pkg-config.
> $ 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
It seems that your build architecture is x86_64-linux-gnu. In this line,
you are passing build architecture flags to a host architecture
compiler. That's an error.
Please use arm-linux-gnueabi-pkg-config.
Helmut
Reply to: