Helloworld cross-compile error

View: New views
9 Messages — Rating Filter:   Alert me  

Helloworld cross-compile error

by titusgroan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

I am trying to compile helloworld for an Overo Fire as follows:

/home/rsumman/oe/tmp/cross/armv7a/arm-angstrom-linux-gnueabi/bin/gcc myHelloworld.c -o myHelloworld

and in doing this the following error is thrown:

gcc: error trying to exec 'cc1': execvp: No such file or directory

I have read elsewhere that there is likely to be something wrong with the gcc installation if such an error occurs so I deleted /oe/tmp and did a bitbake omap3-console-image to regenerate the tmp directory, however, this didn't alleviate the problem. I am doing something stupid?

Any help is appreciated

Cheers

Titusgroan



Re: Helloworld cross-compile error

by ScottEllis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Try a makefile like this (didn't try it so there is probably a typo in there, but you'll
get the idea.)
...

OETMP = ~/overo-oe/tmp

TOOLDIR = ${OETMP}/cross/armv7a/bin

STAGEDIR = ${OETMP}/staging/armv7a-angstrom-linux-gnueabi/usr

CC = ${TOOLDIR}/arm-angstrom-linux-gnueabi-gcc

CFLAGS = -Wall -Wextra -Werror

LIBDIR = ${STAGEDIR}/lib

INCDIR = ${STAGEDIR}/include

LIBS = -L ${LIBDIR}

myHelloworld : myHelloworld.o
        ${CC} ${CFLAGS} ${OBJS} ${LIBS} -o myHelloworld

myHelloworld.o: myHelloworld.c
        ${CC} ${CFLAGS} -I ${INCDIR} -c myHelloworld.c


Re: Helloworld cross-compile error

by titusgroan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes this worked thanks. Another question: I need to pull in some header files from /usr/local/include/opencv and some libraries: /usr/local/lib -lm -lcv -lhighgui -lcvaux how do I do this in the makefile? I have searched online but didn't come across anything to say how to do this.

Cheers

Titusgroan


sellis wrote:
Try a makefile like this (didn't try it so there is probably a typo in there, but you'll
get the idea.)
...

OETMP = ~/overo-oe/tmp

TOOLDIR = ${OETMP}/cross/armv7a/bin

STAGEDIR = ${OETMP}/staging/armv7a-angstrom-linux-gnueabi/usr

CC = ${TOOLDIR}/arm-angstrom-linux-gnueabi-gcc

CFLAGS = -Wall -Wextra -Werror

LIBDIR = ${STAGEDIR}/lib

INCDIR = ${STAGEDIR}/include

LIBS = -L ${LIBDIR}

myHelloworld : myHelloworld.o
        ${CC} ${CFLAGS} ${OBJS} ${LIBS} -o myHelloworld

myHelloworld.o: myHelloworld.c
        ${CC} ${CFLAGS} -I ${INCDIR} -c myHelloworld.c

Re: Helloworld cross-compile error

by ScottEllis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You don't want the libraries from /usr/local/lib, those are binaries for your dev machine, not for an overo.
Run

bitbake opencv

and you'll get the opencv libraries and include files installed in your cross staging directories.

You don't have to change anything in the makefile for the includes if you use the example
from before. The bitbake recipe puts the libraries and includes under .../staging/.../usr/
not .../staging/.../usr/local/

like on your dev machine.

For the libraries, make this change.

LIBS = -L ${LIBDIR} -lm -lcv -lhighgui -lcvaux

For help with compiler/linker switches in your makefile look in the gcc manual.

Re: Helloworld cross-compile error

by titusgroan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Sellis

I followed your instructions and things are working nicely. In addition to cross compiling code from development machine onto Overo, I have been trying to do some stuff on board. Using gcc on my Overo I tried to compile helloworld.c as follows:

root@overo:  /usr/bin/arm-angstrom-linux-gnueabi-gcc helloTest.c -o helloTest

resulting in the following output:

/usr/lib/gcc/arm-angstrom-linux-gnueabi/4.3.3/../../../crt1.o: In function `_start':
init.c:(.text+0x2c): undefined reference to `__libc_csu_fini'
init.c:(.text+0x34): undefined reference to `__libc_csu_init'
collect2: ld returned 1 exit status

any ideas about this error? Your help is much appreciated.

Cheers

Titusgroan



sellis wrote:
You don't want the libraries from /usr/local/lib, those are binaries for your dev machine, not for an overo.
Run

bitbake opencv

and you'll get the opencv libraries and include files installed in your cross staging directories.

You don't have to change anything in the makefile for the includes if you use the example
from before. The bitbake recipe puts the libraries and includes under .../staging/.../usr/
not .../staging/.../usr/local/

like on your dev machine.

For the libraries, make this change.

LIBS = -L ${LIBDIR} -lm -lcv -lhighgui -lcvaux

For help with compiler/linker switches in your makefile look in the gcc manual.

Re: Helloworld cross-compile error

by ScottEllis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think the following is about the minimum required to build C programs
on an Overo.

make_3.81-r0.3_armv7a.ipk
gcc_4.3.3-r7.1.3_armv7a.ipk
gcc-symlinks_4.3.3-r7.1.3_armv7a.ipk
libgmp3_4.2.4-r0.4.3_armv7a.ipk
libmpfr1_2.3.1-r0.3_armv7a.ipk
cpp_4.3.3-r7.1.3_armv7a.ipk
cpp-symlinks_4.3.3-r7.1.3_armv7a.ipk
linux-libc-headers-dev_2.6.23-r4.3_armv7a.ipk
libthread-db1_2.9-r35.2.3_armv7a.ipk
glibc-extra-nss_2.9-r35.2.3_armv7a.ipk
libc6-dev_2.9-r35.2.3_armv7a.ipk

I'd try installing these and then see what happens.

Re: Helloworld cross-compile error

by Philip Balister :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 10/31/2009 01:56 PM, sellis wrote:
>
> I think the following is about the minimum required to build C programs
> on an Overo.

Install task-native-sdk.

Philip

>
> make_3.81-r0.3_armv7a.ipk
> gcc_4.3.3-r7.1.3_armv7a.ipk
> gcc-symlinks_4.3.3-r7.1.3_armv7a.ipk
> libgmp3_4.2.4-r0.4.3_armv7a.ipk
> libmpfr1_2.3.1-r0.3_armv7a.ipk
> cpp_4.3.3-r7.1.3_armv7a.ipk
> cpp-symlinks_4.3.3-r7.1.3_armv7a.ipk
> linux-libc-headers-dev_2.6.23-r4.3_armv7a.ipk
> libthread-db1_2.9-r35.2.3_armv7a.ipk
> glibc-extra-nss_2.9-r35.2.3_armv7a.ipk
> libc6-dev_2.9-r35.2.3_armv7a.ipk
>
> I'd try installing these and then see what happens.
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gumstix-users mailing list
gumstix-users@...
https://lists.sourceforge.net/lists/listinfo/gumstix-users

Re: Helloworld cross-compile error

by Charles Woloszynski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Does anyone else have issues with opkg and installing this?  When I  
include  'task-native'sdk' in my recipes (based on omap3-console-
image), I get opkg errors.

I am building on ubuntu 9.04 if that matters.



On Nov 1, 2009, at 8:50 AM, Philip Balister wrote:

> On 10/31/2009 01:56 PM, sellis wrote:
>>
>> I think the following is about the minimum required to build C  
>> programs
>> on an Overo.
>
> Install task-native-sdk.
>
> Philip
>
>>
>> make_3.81-r0.3_armv7a.ipk
>> gcc_4.3.3-r7.1.3_armv7a.ipk
>> gcc-symlinks_4.3.3-r7.1.3_armv7a.ipk
>> libgmp3_4.2.4-r0.4.3_armv7a.ipk
>> libmpfr1_2.3.1-r0.3_armv7a.ipk
>> cpp_4.3.3-r7.1.3_armv7a.ipk
>> cpp-symlinks_4.3.3-r7.1.3_armv7a.ipk
>> linux-libc-headers-dev_2.6.23-r4.3_armv7a.ipk
>> libthread-db1_2.9-r35.2.3_armv7a.ipk
>> glibc-extra-nss_2.9-r35.2.3_armv7a.ipk
>> libc6-dev_2.9-r35.2.3_armv7a.ipk
>>
>> I'd try installing these and then see what happens.
>>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart  
> your
> developing skills, take BlackBerry mobile applications to market and  
> stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> gumstix-users mailing list
> gumstix-users@...
> https://lists.sourceforge.net/lists/listinfo/gumstix-users


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gumstix-users mailing list
gumstix-users@...
https://lists.sourceforge.net/lists/listinfo/gumstix-users

Re: Helloworld cross-compile error

by lerikson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



Hey there,

I've got an OVERO water that I'm trying to develop.  When I attempt what you
describe below using my OE implementation I get "as: unrecognized option
'-meabi=4'".

Am I missing some flags on the compiler?  Where is that option coming from
anyway?

Thanks,
Luke





sellis wrote:

>
> Try a makefile like this (didn't try it so there is probably a typo in
> there, but you'll
> get the idea.)
> ...
>
> OETMP = ~/overo-oe/tmp
>
> TOOLDIR = ${OETMP}/cross/armv7a/bin
>
> STAGEDIR = ${OETMP}/staging/armv7a-angstrom-linux-gnueabi/usr
>
> CC = ${TOOLDIR}/arm-angstrom-linux-gnueabi-gcc
>
> CFLAGS = -Wall -Wextra -Werror
>
> LIBDIR = ${STAGEDIR}/lib
>
> INCDIR = ${STAGEDIR}/include
>
> LIBS = -L ${LIBDIR}
>
> myHelloworld : myHelloworld.o
>         ${CC} ${CFLAGS} ${OBJS} ${LIBS} -o myHelloworld
>
> myHelloworld.o: myHelloworld.c
>         ${CC} ${CFLAGS} -I ${INCDIR} -c myHelloworld.c
>
>
>

--
View this message in context: http://old.nabble.com/Helloworld-cross-compile-error-tp26087198p26462782.html
Sent from the Gumstix mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gumstix-users mailing list
gumstix-users@...
https://lists.sourceforge.net/lists/listinfo/gumstix-users