Sure. I do it all the time. The easiest thing to do is put together
a makefile. The important part is the toolchain definition, for instance:
TOOLCHAIN=$(OVEROTOP)/tmp/cross/armv7a
STAGING=$(OVEROTOP)/tmp/staging/armv7a-angstrom-linux-gnueabi/usr
TOOLDIR=$(TOOLCHAIN)/bin
CXX=$(TOOLDIR)/arm-angstrom-linux-gnueabi-gcc
STRIP=$(TOOLDIR)/arm-angstrom-linux-gnueabi-strip
LIBDIR=$(STAGING)/lib
INCDIR=$(STAGING)/include
LIBS=$(TOOLCHAIN)/arm-angstrom-linux-gnueabi/lib/libstdc++.a -L$(LIBDIR)
LINK=$(CXX)
My compile rule looks like:
%.o: %.cpp
$(CXX) $< -I $(INCDIR) -fno-rtti -o $@
I build the list of objects (since I have a parameter dirven variable
mix of C and C++ modules), and link with:
$(TARGET) : $(OBJS)
$(LINK) -o $(TARGET) -Wl $(DEBUG) $(OBJS) $(LIBS)
Obviously, for a simple program you can combine it into a single compile
and link step. The important part is getting the include path and
library path right. You have to have done a bitbake once to have
generated the toolchain and staging area, but for simple programs you
don't have to do it again.
Bruce
Tony_Toulouse wrote:
> Hello,
>
> Is there any way of compiling a simple helloworld.c using cross compilation
> (I'm on uBuntu 9.04) and without doing a bitbake? like under linux when
> doing "gcc hello.c -o hello".
>
> Thanks for your help,
>
> Tony
>
------------------------------------------------------------------------------
_______________________________________________
gumstix-users mailing list
gumstix-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gumstix-users