maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   c++ getting started guide for maemo4 (https://talk.maemo.org/showthread.php?t=23074)

jaeezzy 2008-08-22 10:06

c++ getting started guide for maemo4
 
Hi I noticed two installer files in application manager and I'm wondering what they are for actually. 1)libillumination0 (A C++ library for creating GUIs) 2)maemo-cplusplus-device-env (Metapackage for running and debugging C++ applications on the device). So, does this mean that I can compile and run c++ files in n810 itself without the help of PC to compile? Can these be used to make GUIs? If its possible, then where can I find getting started guides for this? Any help will be appriciated. Thanks.

BruceL 2008-08-22 22:46

Re: c++ getting started guide for maemo4
 
I don't think that maemo-cplusplus... will install on the device. At least it didn't seem to work for me.

BUT, if you install gcc and g++ you can build c and c++ and link to whatever you want. I build OpenGL code all the time on the device. You can also use gdb to debug and there are several great editors. Probably geany is the best so far.

Good luck!

jaeezzy 2008-08-24 05:17

Re: c++ getting started guide for maemo4
 
Thanks for the reply brucel but where can i get gcc and g++. Is gdb and geany for IT only. Where can I find 'em. Thanks

fms 2008-08-24 05:34

Re: c++ getting started guide for maemo4
 
Quote:

Originally Posted by jaeezzy (Post 216893)
Thanks for the reply brucel but where can i get gcc and g++. Is gdb and geany for IT only. Where can I find 'em. Thanks

Here:

http://ageofikon.info/packrat/index....ection=&Repo=0

jaeezzy 2008-08-24 09:05

Re: c++ getting started guide for maemo4
 
cool, thanks.. so which ones are essential and which ones can I omit. Is there any getting started guides for this coz it will be very helpful for me to get started speciall when its a kinda new language with new files on a new device. Thanks.

geneven 2008-08-24 11:57

Re: c++ getting started guide for maemo4
 
You can get geany all over the place, at least for Linux.

fms 2008-08-24 12:01

Re: c++ getting started guide for maemo4
 
Quote:

Originally Posted by jaeezzy (Post 216925)
cool, thanks.. so which ones are essential and which ones can I omit. Is there any getting started guides for this coz it will be very helpful for me to get started speciall when its a kinda new language with new files on a new device.

You probably want the one labelled "base package". But please be aware that if you are new to C++, you should download and use Maemo SDK on the desktop instead. Compiling C++ programs directly on the tablet has its uses, but it is a bit more advanced than a novice C++ user would be able to handle.

BruceL 2008-08-25 05:22

Re: c++ getting started guide for maemo4
 
I believe that the debs you need are in the extras repository. if not, just search for them.

Install gcc and gcc-3.4

then Install g++ and g++-3.4

That is technically all you need but you will have to use a lousy text editor.
If you have a bluetooth keyboard geany is great. Just search for a thread on these forums. It's in the first post.

If you are ok with the command line you can install the joe editor. There are a variety of editors and any of them will work, but those that highlight C++ syntax and show line numbers are helpful.

I also suggest installing gdb. It's a standard linux debugger. But don't overwhelm yourself.

Here is what you do:

Type your program in using a text editor and save it with the ending .cpp (or .h for the header file)

Next, run xterm and "cd" to the folder where you saved your files. So, if you saved them in MyDocs/MyPrograms type cd /home/user/MyDocs/MyProrgams


Now type

g++ MyProgName.cpp

If all goes well you will have a program called MyProgName.a (I think .a is the default)

The very first time you will need to type chmod +x MyProgName.a
That sets execution permissions.

To run the program type

./MyProgName.a

There are a lot of command line option to gdb. I suggest following some kind of "dummies guide" your first time.

Good luck!

jaeezzy 2008-08-25 13:34

Re: c++ getting started guide for maemo4
 
Thank you..

jaeezzy 2008-08-26 02:09

Re: c++ getting started guide for maemo4
 
files in this link: http://ageofikon.info/packrat/index....ection=&Repo=0 dont seem to be available. When I tried downloading it using my IT it says package not available.

BruceL 2008-08-26 09:02

Re: c++ getting started guide for maemo4
 
The easiest way to find a repositiry is often to go to

http://gronmayer.com/it/index.php

and search for what you want. (e.g., gcc) It can automatically add the repositiry for you. (You may need "red pill mode".)

I didn't give the link directly because I don't know whether you have chinook, diablo, or something else.

jaeezzy 2008-08-26 22:54

Re: c++ getting started guide for maemo4
 
Quote:

Originally Posted by fms (Post 216945)
You probably want the one labelled "base package". But please be aware that if you are new to C++, you should download and use Maemo SDK on the desktop instead. Compiling C++ programs directly on the tablet has its uses, but it is a bit more advanced than a novice C++ user would be able to handle.

Yeah I'm new, so what things should I be aware of? and what uses does it have and what do you mean by bit more advance? Can I have any information regarding this things? coz before I do anything I wanna know what I'm doing. Thanks..

danramos 2008-08-26 23:14

Re: c++ getting started guide for maemo4
 
Quote:

Originally Posted by jaeezzy (Post 217927)
Yeah I'm new, so what things should I be aware of? and what uses does it have and what do you mean by bit more advance? Can I have any information regarding this things? coz before I do anything I wanna know what I'm doing. Thanks..

Ditto. Is there any easy way to get started in C++ for maemo? Getting started in Python has been a breeze. I can literally pick up a tutorial and begin using vim and learn Python... but C++ isn't as easy to get into on maemo versus getting going on a Linux desktop.

For instance, how would I use cc on a Linux desktop system to compile my own ARMEL executable to run on the tablet? (Even simple console apps?)

Just curious to find out whether there's any tutorials for fellow hacks who're trying to learn to write simple apps for our tablets or something.

Stokstaartje 2008-08-27 13:26

Re: c++ getting started guide for maemo4
 
Quote:

Originally Posted by jaeezzy (Post 216352)
Hi I noticed two installer files in application manager and I'm wondering what they are for actually. 1)libillumination0 (A C++ library for creating GUIs) 2)maemo-cplusplus-device-env (Metapackage for running and debugging C++ applications on the device).

So what do these packages actually do/install? I tried installing the metapackage and that went well...

jaeezzy 2008-08-28 07:07

Re: c++ getting started guide for maemo4
 
Quote:

Originally Posted by BruceL (Post 217179)
If all goes well you will have a program called MyProgName.a (I think .a is the default)

Thanks bruce, I created, compiled and executed my first simple cpp application in my tablet. while compilin it actually created a "a.out" file and did accordingly what you said and got the output. cool.
Btw, the geanu editor is very fascinating but had trouble doing a lot of things. Hopefully, there will be soon all-working version of it. Also can you suggest me of the proceedure I'll require to run ruby programs in my tablet. It will be super cool coz I'm doing ruby at the moment in my uni and it's already been super cool for cpp coz next semester I'll be doing cpp. Thank you.

BruceL 2008-08-28 07:29

Re: c++ getting started guide for maemo4
 
"a.out." that's right. I always use a makefile to force it to use a name like "prog.exe". You're quite right about Geany being imperfect. The main things are that it doesn't use the onscreen keyboard and it doesn't respond to the "enter" key unless you tap it five times really fast.

If you are trying to learn c++, think about trying to fix these two bugs as a learning project! :)

You can also install KDE and use the KATE editor. As for Ruby, I imagine the process is similar, but I haven't done it so I don't know.

jaeezzy 2008-09-01 09:55

Re: c++ getting started guide for maemo4
 
Thanks for the reply brucel, ya that could be my project to fix things up for better use but may be after a year atleast coz I've only very little knowledge of c++ (console programs) no knowledge of GUI's at all in C++. By the way, I'm trying to use geany as it looks great but some problems:
There's no where in the world I could find the curly braces which I'll need-"{ }"
I could compile the source file but how can I run it. Coz when I tried execute from the menu item it says "failed to execute the terminal program". I have downloaded all gcc's, g++'s and make. Thanks

BruceL 2008-09-02 08:31

Re: c++ getting started guide for maemo4
 
I have never tried to run programs under geany. I am sure that there are settigns that would make it work but I don't know what they are. Tto me, using the command-line in xterm seems easier and more flexable.

lcuk 2008-09-02 09:20

Re: c++ getting started guide for maemo4
 
jaeezzy,

I think you have dived in at the deep end with wanting to setup and configure c++ directly on the device.
I would recommend getting some experience with native linux development using a desktop before you transfer your superpowers to the tablet.
The gnu development process is covered in many places online and is used by thousands of people worldwide.
Take the time to readup and practice using gcc and make etc in a general sense :)

If you do not have a linux desktop I would recommend finding out about the maemo vmware image, this has a preconfigured development environment and might be a little easier to understand.

Unfortunately, there is no shortcut to becoming a linux-dev-guru, I've been trying for months now and haven't progressed that far.

BruceL 2008-09-02 14:48

Re: c++ getting started guide for maemo4
 
lcuk is right that there is no shortcut to knowledge. I probably slowed you down by telling you how to get started because in figuring it out for yourself you would have learned a lot that you won't have the motivation to learn now.

That said, with a big enough SD card there is very little that you can do on a desktop that you can't do on the tablet. My N800 is the only computer I use. I have built several large packages directly on the tablet. But you do have to learn a bit to get it working and it isn't as fast as a desktop.

lcuk 2008-09-02 16:27

Re: c++ getting started guide for maemo4
 
BruceL,

how didyou manage to get over the "configure" dependency problem?

(it depends on debiantools which needs replacing basically taking the entire house of cards with it)
I aim to do as much as possible on the tablet, but am aware its not that practical for everything.

BruceL 2008-09-02 17:25

Re: c++ getting started guide for maemo4
 
I used to have the entire maemo sandbox on my NIT and chroot into it. If that is too much you might try building under the debian chroot. Lastly, you can probably extract the files from the debianutils using dpkg -x and then copy them into place manually. I've done that with a number of things.

Another problem is that for large builds your /tmp directory will run out of space. I have a script that fixes this.

For software you write yourself, however, all you need is the compiler(s) and make.

lcuk 2008-09-02 17:31

Re: c++ getting started guide for maemo4
 
BruceL,
thanks for the info, I've managed to get the debian package builder onto my 810 with a bit of foo, but didn't find a straight forward way to get configure working myself.
maybe I will try again at some later date, but first I've got my own code to finish.


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

vBulletin® Version 3.8.8