Question about crosscompile of X11 application

Hi,
I'm building a Xlib-based application on Ubuntu installed BeagleBoard.
I use a CodeSourcery 2009q1

On compilation these messages showed as follows.

/home/gorn/bin/arm-2009q1-203/bin/../lib/gcc/arm-none-linux-gnueabi/
4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: skipping
incompatible /lib/libc.so.6 when searching for /lib/libc.so.6
/home/gorn/bin/arm-2009q1-203/bin/../lib/gcc/arm-none-linux-gnueabi/
4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find /lib/
libc.so.6

command line is here.
arm-none-linux-gnueabi-gcc -b arm-none-linux-gnueabi -o
minclient.arm.o minclient.c -I ~/rootfs/20090924/usr/include/ -lX11 -L
~/rootfs/20090924/usr/lib/ -g

I found this question at Japanese Ubuntu forum. Maybe same case. Of
course this entry is written in Japanese.
https://forums.ubuntulinux.jp/viewtopic.php?pid=38751

Hi

On compilation these messages showed as follows.

/home/gorn/bin/arm-2009q1-203/bin/../lib/gcc/arm-none-linux-gnueabi/
4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: skipping
incompatible /lib/libc.so.6 when searching for /lib/libc.so.6
/home/gorn/bin/arm-2009q1-203/bin/../lib/gcc/arm-none-linux-gnueabi/
4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find /lib/
libc.so.6

command line is here.
arm-none-linux-gnueabi-gcc -b arm-none-linux-gnueabi -o
minclient.arm.o minclient.c -I ~/rootfs/20090924/usr/include/ -lX11 -L
~/rootfs/20090924/usr/lib/ -g

You can try with --sysroot parameter point to ~/rootfs/20090924/

Regards,
-Hieu

Thanks Hieu,

after append --sysroot option

This error message showed as follows.

/home/gorn/bin/arm-2009q1-203/bin/../lib/gcc/arm-none-linux-gnueabi/
4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lgcc_s

Command line is here

~/sample/x11/minclient$ arm-none-linux-gnueabi-gcc -b arm-none-linux-
gnueabi -o minclient.arm.o minclient.c -I ~/rootfs/20090924/usr/
include/ -lX11 -L ~/rootfs/20090924/usr/lib/ -g --sysroot ~/rootfs/
20090924/

Gorn,

It's very important that you cross-link your program using the
target's .so files. It may be that you're using host .so files
instead of target .so files.

Here's how I got this to work using Windows/Cygwin as a development
environment:

http://www.elinux.org/BeagleBoardFAQ#Windows.2FCygwin_.233

Another suggestion is to compile and link using the "-v" (verbose)
option to find out what the compiler and linker think they're doing.

Hope this helps,
John