Compiling on the N810

(Compiling on the N810)
(Compiling on the N810)
Line 1: Line 1:
-
== Compiling on the N810 ==
+
= Compiling on the N810 =
* [[install openssh on the N810]]
* [[install openssh on the N810]]
* 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 ([http://wiki.maemo.org/Codenames more info]).
* 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 ([http://wiki.maemo.org/Codenames more info]).
Line 21: Line 21:
  Nokia-N810-43-7:~# ./greeter
  Nokia-N810-43-7:~# ./greeter
  hello worldNokia-N810-43-7:~#
  hello worldNokia-N810-43-7:~#
 +
 +
= C++ =
 +
* Try to compile a C++ program
 +
Nokia-N810-43-7:/media/mmc1# cat 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)
 +
 +
* download g++
 +
wget http://repository.maemo.org/pool/maemo4.1.2/free/g/gcc-3.4/g++-3.4_3.4.4cs2005q3.2-5.osso8_armel.deb
 +
 +
* download lib standard C++
 +
wget http://repository.maemo.org/pool/maemo4.1.2/free/g/gcc-3.4/libstdc++6-dev_3.4.4cs2005q3.2-5.osso8_armel.deb
 +
 +
* 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
 +
 +
* try to compile main.cpp again
 +
gcc-3.4 main.cpp
 +
/var/tmp/ccQkm9NS.o: In function `std::__verify_grouping...
 +
 +
* ok, but do it right
 +
gcc-3.4 -lstdc++ main.cpp
 +
./a.out
 +
hello C++

Revision as of 21:40, 28 December 2009

Compiling on the N810

wget http://repository.maemo.org/pool/maemo4.1.2/free/g/glibc/libc6-dev_2.5.0-1osso10_armel.deb
  • get linux kernel headers
wget http://repository.maemo.org/pool/maemo4.1.2/free/l/linux-kernel-headers/linux-kernel-headers_2.6.16.osso11-1_armel.deb
  • get libgcc
wget http://repository.maemo.org/pool/maemo4.1.2/free/g/gcc-3.4/libgcc1_3.4.4cs2005q3.2-5.osso8_armel.deb
  • install everything
dpkg -i gcc-3.4_3.4.4cs2005q3.2-5.osso8_armel.deb libc6-dev_2.5.0-1osso10_armel.deb linux-kernel-headers/linux-kernel-headers_2.6.16.osso11-1_armel.deb
  • do the usual test
Nokia-N810-43-7:~# cat 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:~#

C++

  • Try to compile a C++ program
Nokia-N810-43-7:/media/mmc1# cat 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)
  • download g++
wget http://repository.maemo.org/pool/maemo4.1.2/free/g/gcc-3.4/g++-3.4_3.4.4cs2005q3.2-5.osso8_armel.deb
  • download lib standard C++
wget http://repository.maemo.org/pool/maemo4.1.2/free/g/gcc-3.4/libstdc++6-dev_3.4.4cs2005q3.2-5.osso8_armel.deb
  • 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
  • try to compile main.cpp again
gcc-3.4 main.cpp
/var/tmp/ccQkm9NS.o: In function `std::__verify_grouping...
  • ok, but do it right
gcc-3.4 -lstdc++ main.cpp
./a.out
hello C++