| Prev |   3     4   5   6     7   | Next | Last
maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   On-device development in C/C++? (https://talk.maemo.org/showthread.php?t=34412)

endboss 2010-01-24 16:24

Re: C/C++ program for n900
 
Quote:

Originally Posted by CharlesM (Post 491609)
Do I really need all of this to compile simple command line progs?

For compiling small programs it is absolutly sufficient to install gcc [~9MB] and g++ (if needed) [~14MB] only. No build-essential and all that stuff. If you have no other unoptified stuff installed you should have no problems installing those packages. I did that, I have enough space left and for small on device compiling I have all I need.

daperl 2010-01-24 16:38

Re: C/C++ program for n900
 
Quote:

Originally Posted by nicola.mfb (Post 491765)
Hi, it may be interesting to put the sdk on an external microSD (like debootstrap but with maemo and sdk repositories), use chroot to develop and copy the results on the real OS.
Some hints for that?

This is a great idea. If someone doesn't pick this up before me I'll definitely go this route when I get back to this stuff. Unfortunately, my schedule is screwed for the next 3 weeks. In the meantime, just because, here are some instructions to get an SD card rollin':

Maybe choose a Class 6 from this page. I recently purchased this one. Then:

Turn off
Insert microSD card in n900
Turn on
And as root in an xterminal, type the following:

WARNING: Same as above

sfdisk /dev/mmcblk1 << EOS
,100,b***
,3900,L
,,L
EOS
# be patient and wait for the prompt to come back
mkfs.vfat /dev/mmcblk1p1
mkfs.ext3 /dev/mmcblk1p2
mkfs.ext3 /dev/mmcblk1p3
mkdir -p /mnt/mmc12
mount -t ext3 -o noatime,data=writeback /dev/mmcblk1p2 /mnt/mmc12
mount / /floppy
cp -a /floppy /mnt/mmc12/.chroot
# Be even more patient

The next step would be either the big post above (with a tiny list of other things) or a debian installer to be named later :eek:.

Quote:

Originally Posted by CharlesM (Post 491609)
Do I really need all of this to compile simple command line progs?

You don't need to do everything from the big post to get simple compiling going. After you get to the package install step, just install build-essential:

apt-get install build essential

Then you should be able to:

gcc mybiitchinapp.c -o mybiitchinapp

***This has a side effect (possibly bad) of letting certain programs think this vfat area is an archive space. I left it in because I think it makes booting from an SD card less painful (if one were to decide to go that route), but don't quote me on that.

nicola.mfb 2010-01-30 15:53

Re: C/C++ program for n900
 
Ok, I managed to have a nice SDK partition, here some hints:

* mmcblk1p1 (or another sd partition) formatted and mounted on /sdk
* extract maemo-sdk-rootstrap_5.0_armel.tgz to /sdk
* create dev and mount it from real dev with mount -o bind
* mount /sdk/dev/pts, /sdk/proc and /sdk/sys properly (not sure about the last two, the first is necessary to avoid apt-get errors)
* add to /etc/apt/sources.list the line:
Code:

deb http://repository.maemo.org/ fremantle/xxxxx nokia-binaries
replace xxxxx with the exact string from your scratchbox installation.

That's all, I just checked out a my qt4 project and compiled with:

* chroot /sdk
* apt-get update
* apt-get install libqt4-dev
* cd blah
* qmake
* make

Please test and elaborate the above instruction, and provide further hints to have all automounted and working at device boot :)

Regards

Niko

jaeezzy 2010-02-07 09:26

Re: C/C++ program for n900
 
Quote:

Originally Posted by nicola.mfb (Post 502640)
Ok, I managed to have a nice SDK partition, here some hints:

* mmcblk1p1 (or another sd partition) formatted and mounted on /sdk
* extract maemo-sdk-rootstrap_5.0_armel.tgz to /sdk
* create dev and mount it from real dev with mount -o bind
* mount /sdk/dev/pts, /sdk/proc and /sdk/sys properly (not sure about the last two, the first is necessary to avoid apt-get errors)
* add to /etc/apt/sources.list the line:
Code:

deb http://repository.maemo.org/ fremantle/xxxxx nokia-binaries
replace xxxxx with the exact string from your scratchbox installation.

That's all, I just checked out a my qt4 project and compiled with:

* chroot /sdk
* apt-get update
* apt-get install libqt4-dev
* cd blah
* qmake
* make

Please test and elaborate the above instruction, and provide further hints to have all automounted and working at device boot :)

Regards

Niko

Hi niko,
I would be very grateful if you could kindly elaborate each step and kinda make it step by step guide for biginners/average users. I have managed to install build-essential and gtk+ on the device itself and looking to finally get the maemo sdk and figured out, from what I saw here, is quite a bit of work for average user like me. Also agreed that its good to have it separately from the OS. Thank you.

P.S However isn't it possible to just install the packages required to compile hildon applications. thanks

madmaze 2010-02-11 16:06

developing apps directly on the n900 with c
 
hello everyone,
is there a way i can compile and and develop directly on the n900?
ive tried to apt-get install gcc g++
but it tells me there is no installable candidate..

can anyone point me in the right direction?

verhagke 2010-02-11 16:25

Re: developing apps directly on the n900 with c
 
I don't believe that a compiler has been ported yet

Rob1n 2010-02-11 16:31

Re: developing apps directly on the n900 with c
 
See this thread which seems to have covered the same question.

alex94 2010-02-16 12:33

Re: C/C++ program for n900
 
Quote:

Originally Posted by endboss (Post 492059)
For compiling small programs it is absolutly sufficient to install gcc [~9MB] and g++ (if needed) [~14MB] only. No build-essential and all that stuff. If you have no other unoptified stuff installed you should have no problems installing those packages. I did that, I have enough space left and for small on device compiling I have all I need.

How have you installed GCC?
I tried this but it doesn't work:
$ sudo gainroot
$ apt-get install gcc

Thanks

endboss 2010-02-17 12:34

Re: C/C++ program for n900
 
Quote:

Originally Posted by alex94 (Post 529404)
How have you installed GCC?
I tried this but it doesn't work:
$ sudo gainroot
$ apt-get install gcc

Thanks

You probably didn't add the sources.
Edit /etc/apt/sources.list and add the following line to it:
deb http://repository.maemo.org fremantle/sdk free non-free
The fastest way to accomplish this is like this:
echo "deb http://repository.maemo.org fremantle/sdk free non-free" >> /etc/apt/sources.list
Afterwards type apt-get update. Now the installation should work.

alex94 2010-02-17 16:39

Re: C/C++ program for n900
 
Thanks enboss gcc is now on my machine.
I can compile C files, but how can i execute them?
I tried:
$ sudo gainroot
$ ./test
Error is: Permission denied
So i tried:
$ sudo ./test
but this doesn't work too :(


| Prev |   3     4   5   6     7   | Next | Last
All times are GMT. The time now is 08:42.

vBulletin® Version 3.8.8