The GNU Compiler Collection (GCC) can be installed in Maemo on Nokia N900, which allows on device development! To install them, first add the Maemo SDK repository to the application catalogs. Do *not* run upgrade (apt-get upgrade) after enabling the SDK repository. After the installation of the build tools, disable the SDK repository. Once the repo is disabled we can run apt-get upgrade command safely if necessary.

Catalog name: maemo sdk
Web address: http://repository.maemo.org
Distribution: fremantle/sdk
Components: free non-free

After reloading, close the application manager.
In the terminal, run the following.

root
apt-get update
apt-get install build-essential #installs the necessary packages
exit

Open the application manager and disable the SDK repository. After that run update.

apt-get update