The native sdk provides an easy way to start developing (c/c++) on board. It contains gcc, the header files and the commmon utilities (make..) used to compile applications.

Installing the sdk

  1. Install pcre.
  2. Because the version of grep from the sdk needs it, and it will comes first in your path, before the busybox version.

  3. Download the zgcc-XXX.img
  4. For rc12: zgcc-3.4.4.img

  5. Mount the image file
  6. One way to do this is to put the zgcc-XXX.img in /home/root and reboot.
    You can also put the file somewhere, create a link to this file in /home/root and reboot. For instance if you put the file in /mnt/card you need to type:

    ln -s /mnt/card/zggc-3.4.4.img /home/root
    

    You can also mount the image by hand, but you have to make sure that the image is mounted at the right place. Otherwise gcc will not work correctly.
    You can find the path by doing the following in a terminal

    # grep zgcc /etc/rc.d/rc.sysinit
    if [ -f /home/root/zgcc-3.4.4.img ]; then
        mount -o loop /home/root/zgcc-3.4.4.img /opt/native/arm/3.4.4-xscale-softvfp
    #
    

    In my case the right path is /opt/native/arm/3.4.4-xscale-softvfp. To mount the image you first need to create the directory if it does not exist and mount the image. For instance, assuming the image is in /mnt/card:

    # mkdir -p /opt/native/arm/3.4.4-xscale-softvfp
    # mount -o loop /mnt/card/zggc-3.4.4.img /opt/native/arm/3.4.4-xscale-softvfp
    

    That's it

Compiling

If you want to see gcc in action try:

# echo -e '#include "stdio.h"\n int main(){ printf("Hello World\\n"); }' > hello.c
# gcc -o hello hello.c
# ./hello
Hello World
#

Common Problem

if you get the following error:

gcc: Internal error: Terminated (program cc1)
Please submit a full bug report.
See  for instructions

It's most probably because you have run out of memory. Compiling requires ram, especially c++ compilation. You can first try to compile without X running, if this is not enough then you have to create a swap.