maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   HOWTO: C/C++ compiling on the unit itself. (https://talk.maemo.org/showthread.php?t=6737)

torx 2007-06-10 09:07

HOWTO: C/C++ compiling on the unit itself.
 
[Last update: 21 July 07]

Here's how to do C/C++ compiling on the unit itself.

What you need:

gainroot
xterm (apt-get install osso-xterm)
wget (Download from: http://maemo.org/downloads/product/wget/)


Instructions:

First, fire up your xterm and type the following lines

Code:

sudo gainroot

//Now cd into a directory with at least 15mb free space

wget http://repository.maemo.org/pool/maemo2.2/free/g/gcc-3.4/libstdc++6_3.4.4cs2005q3.2-5.osso3_armel.deb http://repository.maemo.org/pool/maemo2.2/free/g/gcc-3.4/gcc-3.4_3.4.4cs2005q3.2-5.osso3_armel.deb  http://repository.maemo.org/pool/maemo2.2/free/g/gcc-3.4/libstdc++6-dev_3.4.4cs2005q3.2-5.osso3_armel.deb  http://repository.maemo.org/pool/maemo2.2/free/g/gcc-3.4/g++-3.4_3.4.4cs2005q3.2-5.osso3_armel.deb  http://repository.maemo.org/pool/maemo3.1/free/binary/libc6_2.3.5cs2005q3.2-5.osso12_armel.deb  http://repository.maemo.org/pool/maemo3.1/free/binary/linux-kernel-headers_2.6.16.osso7_armel.deb  http://repository.maemo.org/pool/maemo2.2/free/b/binutils/binutils_2.16.91cs2005q3.2-5.osso1_armel.deb
http://repository.maemo.org/pool/maemo2.2/free/g/gcc-3.4/cpp-3.4_3.4.4cs2005q3.2-5.osso3_armel.deb

//After all the packages are downloaded

dpkg -i binutils_2.16.91cs2005q3.2-5.osso1_armel.deb
dpkg -i linux-kernel-headers_2.6.16.osso7_armel.deb
dpkg -i libc6-dev_2.3.5cs2005q3.2-5.osso12_armel.deb
dpkg -i cpp-3.4_3.4.4cs2005q3.2-5.osso3_armel.deb
dpkg -i gcc-3.4_3.4.4cs2005q3.2-5.osso3_armel.deb

//you will encounter dependencies error with the following steps.
//It's perfectly "alright"

dpkg -i libstdc\+\+6-dev_3.4.4cs2005q3.2-5.osso3_armel.deb
dpkg -i g\+\+-3.4_3.4.4cs2005q3.2-5.osso3_armel.deb

//the following step will fix the depencies error
apt-get -f install

After you have done so, you will now be able to compile with the command

Code:

g++-3.4 yourprogramhere.cpp
**Do note that you will get a permission error if you try to compile your source files located on a vfat storage.

These steps are put together by a linux beginner who has no idea what he is doing. It didn't screw up my installation, but your mileage may vary.

torx 2007-06-24 14:21

Re: HOWTO: C/C++ compiling on the unit itself.
 
I'm not sure if anyone actually cares about this thread, but anyway, some updates.

I have verified that the SciTE editor works fine at compiling c++ programs.

However, to use the compile button on Scite editor, you need to make type the following commands into your xterm.

Code:

sudo gainroot
cd /usr/bin
ln -s g\+\+\-3.4 g\+\+

Using the build command will however require 'make'.

peterjb31 2007-06-24 14:33

Re: HOWTO: C/C++ compiling on the unit itself.
 
Do you by any chance know where a copy of 'make' exists for the device?

torx 2007-06-24 14:41

Re: HOWTO: C/C++ compiling on the unit itself.
 
Here it is.


This should get it installed IF there are no dependencies error. No time to check that now, but i will do that soon.

Code:

sudo gainroot

wget http://repository.maemo.org/pool/maemo2.2/free/m/make/make_3.80-9osso_armel.deb

dpkg -i make_3.80-9osso_armel.deb


robmiller 2007-06-24 14:42

Re: HOWTO: C/C++ compiling on the unit itself.
 
Quote:

Originally Posted by torx (Post 53643)
I'm not sure if anyone actually cares about this thread, but anyway, some updates.

I'm watching and interested :)

rob.

peterjb31 2007-06-24 14:47

Re: HOWTO: C/C++ compiling on the unit itself.
 
No dependency errors. Thanks.

seattleweb 2007-07-17 04:53

Re: HOWTO: C/C++ compiling on the unit itself.
 
Doesn't seem to work :(

Khertan 2007-07-17 05:10

Re: HOWTO: C/C++ compiling on the unit itself.
 
i've successfully install gcc and osso/hildon library before the flash with the new os. But it's take too many place (100Mo).

torx 2007-07-19 13:54

Re: HOWTO: C/C++ compiling on the unit itself.
 
Quote:

Originally Posted by seattleweb (Post 60515)
Doesn't seem to work :(

On the new OS? I have yet to tried it install it on the new OS yet, but i'll try it out this weekend.

edit: realised i left out wget-ing one of the files in my instructions. i have updated it, so try again if you will.

edit: seems like these instructions are not useful on the latest firmware ('chinook').

torx 2007-07-20 15:20

Re: HOWTO: C/C++ compiling on the unit itself.
 
Quote:

Originally Posted by Khertan (Post 60518)
i've successfully install gcc and osso/hildon library before the flash with the new os. But it's take too many place (100Mo).

On a uncompressed ext 2 filesystem, the whole installation takes up 50mb on my system. If you are using the jffs2 filesystem, it should be much lesser.


All times are GMT. The time now is 04:56.

vBulletin® Version 3.8.8