|
Page 2 of 3 |
|
Prev |
1 2
3
|
Next
Re: C/C++ program for n900
Quote:
|
Re: C/C++ program for n900
Quote:
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:
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. |
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-binariesThat'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 |
Re: C/C++ program for n900
Quote:
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 |
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? |
Re: developing apps directly on the n900 with c
I don't believe that a compiler has been ported yet
|
Re: developing apps directly on the n900 with c
See this thread which seems to have covered the same question.
|
Re: C/C++ program for n900
Quote:
I tried this but it doesn't work: $ sudo gainroot $ apt-get install gcc Thanks |
Re: C/C++ program for n900
Quote:
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. |
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 :( |
Re: C/C++ program for n900
The thread "developing apps directly on the n900 with c" with three posts has been merged into this thread.
|
Re: C/C++ program for n900
Quote:
chmod 777 test ./test EDIT: chmod only needs to be done once. |
Re: On-device development in C/C++?
How safe is this considered to be. Any issues with
- disk space with future firmwares - overwriting any existing libraries thus causing incompatibilies/stability. I'm assuming its not just the gcc binary that gets downloaded, but a bunch of dependencies too |
Re: On-device development in C/C++?
I got still the error permission denied :/
chmod seams to be corrupt. |
Re: On-device development in C/C++?
Quote:
|
Re: On-device development in C/C++?
to have only gcc, I edited sources.list and did apt-get install gcc
but it can't find stdio.h and I also get a link error of crt1.o no such file. What other dependencies are needed? how much more is this going to bloat to? |
Re: On-device development in C/C++?
Quote:
I run an SDK in a chroot. Qole is hosting an image here. You can install the easy-chroot scripts and run it without having to worry about bloating your rootfs or installing things on the device that might cause problems with busybox. |
Re: On-device development in C/C++?
This is awesome, just got it set up on my n900. Good work chaps/chapettes! Just compiled my own small game directly on the phone. :D
|
Re: On-device development in C/C++?
Quote:
Thanks for any help! |
Re: On-device development in C/C++?
I just followed this... http://talk.maemo.org/showpost.php?p...5&postcount=19 works a treat :)
|
Re: On-device development in C/C++?
Currently I'm doing it in the same way that that post says. Running it from a file, rather than a separate partition.
Qole also has an easy-chroot guide here. |
Re: On-device development in C/C++?
Quote:
|
Re: On-device development in C/C++?
I've been messing around today trying to get a nice dev enviroment setup. I connect it on usb to my FreeBSD desktop and enable PC Suite Mode so that the USB networking starts, then set an ip on the usb0 interface on the N900 and one on my desktop.
Use sshfs on my desktop to mount the home folder locally so I can use my text editor (NEdit) on a sensible keyboard to edit/hack source. And also have open an ssh session to the n900 for compiling in the qchroot. Perfect, it's just like working locally on my desktop :D Its a surprisingly nippy little machine, a lot quicker at compiling than I thought it would be and with this setup its way more convienient than working with the SDK in a VM. Compile directly on the device and then run it. |
Re: On-device development in C/C++?
Quote:
|
Re: On-device development in C/C++?
The versions that are installed in scratchbox armel seem to work.
Try step 7 of the instructions in this section of the wiki. You'll need to add the source line that you get back after accepting the EULA to your /etc/apt/sources.list within the chroot. Then run apt-get update and apt-get install libqt4-dev. |
Re: On-device development in C/C++?
Quote:
http://lists.trolltech.com/pipermail...ry/000074.html I wonder who provided the ARM binaries for libqt4-dev? Perhaps it could be possible to cross-compile libqt4-maemo5-dev as well. |
Re: On-device development in C/C++?
Trying to compile a program on n900, getting error from .configure.
Code:
gcc (GCC) 4.2.1 |
Re: On-device development in C/C++?
OK found problem!
apt-get install libc6-dev All working |
Re: On-device development in C/C++?
@ lcuk
I followed your instructions but while trying to configure (ipmitool) Code:
Nokia-N900-51-1:/home/user/MyDocs/Downloads/ipmitool-1.8.11# PATH=$PATH:. ; |
Re: On-device development in C/C++?
checking whether the C compiler works... configure: error: cannot run C compiled programs.
Don't do this from within you MyDocs folder. It is on a partitition which is formatted as VFAT and you can not run executables from there. Put your ipmitool-1.8.11 to /home/user/ for example and try again. Nicolai |
Re: On-device development in C/C++?
Quote:
Yes, you did not read everything I said. Quote:
If you investigate the error itself there is potential to get past it. |
Re: On-device development in C/C++?
thats a very common error when preparing an n900 development environment of the device itself.
put your source inside the chroot image or inside /home/user. in other words, dont try to compile from /home/user/MyDocs, because its FAT32. Or mess with ./configure to let you compile outside the source folder. thats because with fat32 you dont get the execution bit. clasificado |
Re: On-device development in C/C++?
Quote:
hmm last time I tried the configure stage would fail with anything, but you are certainly more confident than myself that it should work! this is great if so and removes one block from the way :) it would be best of all if we could optify these build-essential packages and get dpkg-buildpackage working happily. |
Re: On-device development in C/C++?
I must admit, I don't know if the whole configure stage work.
I am working with plain old hand written Makefiles. Nicolai |
Re: On-device development in C/C++?
Quote:
http://xkcd.com/297/ they work well! I have just made libliqbase work on x86 with the ones there :) |
Re: On-device development in C/C++?
Solved: I adapted the /etc/fstab. The home partition where I was building the software was mounted as noexec. I removed that option and it was working :)
|
Re: On-device development in C/C++?
I also prefer to compile on device, and that's my manual, how to do that with FreePascal
|
Re: On-device development in C/C++?
C Programming on Maemo Device (N 900): Mobile C programming lab :cool:
Download the following files to work with gcc • binutils_2.18.50.20070820-4+0m5_armel.deb • libgcc1_4.2.1-4maemo9+0m5_armel.deb • libgomp1_4.2.1-4maemo9+0m5_armel.deb • cpp-4.2_4.2.1-4maemo9+0m5_armel.deb • gcc-4.2-base_4.2.1-4maemo9+0m5_armel.deb • gcc-4.2_4.2.1-4maemo9+0m5_armel.deb 1. connect your N900 to PC and copy above files into one folder ~ $ cd ~/MyDocs //change to this folder in N900 in xterm ~/MyDocs $ cd files //here your above files are copied ~/MyDocs/files $ dpkg –i * // to run all the files in files folder ~/MyDocs/files $ vi hellowrold.c //create a c program by using vi editor Note : for entering any letter you should press “I” to enter in to insert mode Note: to save the files click ESC and shift+: and wq! .so that your c program will be saved.#inlcude <stdio.h> ~/MyDocs/files $ gcc-4.2 hello.c // gcc compiler will compile your c program ~/MyDocs/files $ ls // you will find the output file a.out hello.c ~/MyDocs/files $ sudo gainroot //shell root will be enabled ~home/usr/MyDocs/files # cp a.out /usr/bin // to see the output you should copy this outputfile to bin folder ~/usr/bin # chmod +x a.out // change the permissions ~/usr/bin # ./a.out M. Reddi Prasad Reddy,IP University,Delhi any other ideas and comments Mail id: reddy.mrp@gmail.com |
Re: On-device development in C/C++?
Quote:
Quote:
ESC leaves insertion mode. The command to save and quit is "wq" by itself and one enters command mode using ":". Quote:
Quote:
|
Re: On-device development in C/C++?
Corrected POST: Thank you JOORIN for your comments
~ $ cd ~/MyDocs //change to this folder in N900 in xterm ~/MyDocs $ cd files //here your above files are copied ~/MyDocs/files $ sudo gainroot //shell root will be enabled ~home/usr/MyDocs/files # dpkg –i * // to run all the files in files folder ~home/usr/MyDocs/files # vi hello.c //create a c program by using vi editor Note : for entering any letter you should press “I” to enter in to insert mode #include <stdio.h> main() { Printf(“M. Reddi Prasad Reddy,IP University,Delhi”); } Note:ESC leaves insertion mode. The command to save and quit is "wq" by itself and one enters command mode using ":". ~home/usr/MyDocs/files # gcc-4.2 hello.c // gcc compiler will compile your c program ~home/usr/MyDocs/files # ls // you will find the output file a.out hello.c ~home/usr/MyDocs/files # cp a.out /usr/bin // to see the output you should copy this outputfile to bin folder ~/usr/bin # chmod +x a.out // change the permissions ~/usr/bin # ./a.out M. Reddi Prasad Reddy,IP University,Delhi I have modified the post. this can help people little i have saved the a.out to /usr/bin to execute otherwise its not able to get the permissions.:confused: Q: but still some other N900 devices are not able to install gcc.:confused: |
| All times are GMT. The time now is 08:42. |
Page 2 of 3 |
|
Prev |
1 2
3
|
Next
vBulletin® Version 3.8.8