Compiling on the N810

To compile software for the N810, you can use scratchbox, the cross-compile-environment for i386 machines. Or you can compile on the device itself.

  1. install openssh on the N810
  2. Find out what Maemo version you have. Choose Settings -> Control Panel -> About. If you get "Product maemo Linux based OS2008 Version:5.2008.43-7" this means Maemo 4.1, OS2008 and Diablo (more information on codenames).
  3. download wget from Copy it to your computer and scp it to your N810.
  4. get gcc
  5. get cpp
  6. get binutils
  7. get glibc
  8. get linux kernel headers
  9. get libgcc
  10. install everything
    dpkg -i libgcc1_3.4.4cs2005q3.2-5.osso8_armel.deb linux-kernel-headers_2.6.16.osso11-1_armel.deb libc6-dev_2.5.0-1osso10_armel.deb gcc-3.4_3.4.4cs2005q3.2-5.osso8_armel.deb cpp-3.4_3.4.4cs2005q3.2-5.osso8_armel.deb binutils_2.16.91cs2005q3.2-5.osso1_armel.deb
  11. do the usual test:
/* main.c */
#include <stdio.h>
int main()
{ printf("hello world"); }
Nokia-N810-43-7:~# gcc-3.4 -o greeter main.c
Nokia-N810-43-7:~# ./greeter
hello worldNokia-N810-43-7:~#

[edit] C++

  1. Try to compile a C++ program:
    // main.cpp
    #include <iostream>
    int main()
      std::cout << "hello C++" << std::endl;
    Nokia-N810-43-7:/media/mmc1# gcc-3.4 main.cpp
     <unknown> tried to exec cc1plus but failed (No such file or directory)
  2. download g++:
  3. download lib standard C++:
  4. install g++:
    dpkg -i libstdc++6-dev_3.4.4cs2005q3.2-5.osso8_armel.deb g++-3.4_3.4.4cs2005q3.2-5.osso8_armel.deb
  5. try to compile main.cpp again:
    gcc-3.4 main.cpp
    /var/tmp/ccQkm9NS.o: In function `std::__verify_grouping...
  6. ok, but do it right:
    gcc-3.4 -lstdc++ main.cpp
    hello C++