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

Re: Crosscompile problem



* Thomas Bechtold <tb@ammonit.com> schrieb:
> Hi,
> 
> i want to cross compile a C-Program (host=i386, target=armel). The
> program is:
> 
> #######################
> #include <stdio.h>
> #include <glib.h>
> 
> int main()
> {
> 	printf("Hello world\n");
> 	return (0);
> }
> #######################
> 
> I have installed the cross-compiler from emdebian testing (gcc 4.4) and
> also installed a debian squeeze chroot with armel packages.
> When i try to compile my program, i got the following error:
> 
> $ /usr/bin/arm-linux-gnueabi-gcc `pkg-config
> --define-variable=prefix=/home/test/armel_devel/usr --libs --cflags
> glib-2.0`
> /usr/lib/gcc/arm-linux-gnueabi/4.4.5/../../../../arm-linux-gnueabi/bin/ld: skipping incompatible /home/test/armel_devel/usr/lib/libglib-2.0.so when searching for -lglib-2.0
> /usr/lib/gcc/arm-linux-gnueabi/4.4.5/../../../../arm-linux-gnueabi/bin/ld: skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6
> /usr/lib/gcc/arm-linux-gnueabi/4.4.5/../../../../arm-linux-gnueabi/bin/ld: cannot find /lib/libc.so.6
> collect2: ld returned 1 exit status

Of course! pkg-config gives you wrong library pathes. 
You should use sysroot.


cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@metux.de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------


Reply to: