| Prev |   6     7   8   9   | Next
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)

lcuk 2010-08-17 11:13

Re: On-device development in C/C++?
 
Quote:

Originally Posted by wannessmet (Post 789186)
@ 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:. ;
Nokia-N900-51-1:/home/user/MyDocs/Downloads/ipmitool-1.8.11# sh ./configure
checking build system type... armv7l-unknown-linux-gnu
checking host system type... armv7l-unknown-linux-gnu
checking target system type... armv7l-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/ginstall -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
Nokia-N900-51-1:/home/user/MyDocs/Downloads/ipmitool-1.8.11# checking for gawk... no

Do you have any idea what's going wrong?



Yes, you did not read everything I said.


Quote:

Originally Posted by lcuk (Post 375916)

note, this doesnt bring in autotools or dpkg
so no ./configure stage works, and no dpkg-buildpackage will run.
(normal make files and find an alternative for packaging)

if you don't need them and can work with makefiles its certainly usable and fast.
if you need -dev headers for libraries, expect even more space, I find nowadays I can get by mostly with libliqbase-dev

hth

So, I could not get this to work but did not need it.
If you investigate the error itself there is potential to get past it.

clasificado 2010-08-17 11:16

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

lcuk 2010-08-17 11:20

Re: On-device development in C/C++?
 
Quote:

Originally Posted by nicolai (Post 789191)
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

hey Nicolai,
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.

nicolai 2010-08-17 11:45

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

lcuk 2010-08-17 11:49

Re: On-device development in C/C++?
 
Quote:

Originally Posted by nicolai (Post 789220)
I must admit, I don't know if the whole configure stage work.
I am working with plain old hand written Makefiles.

Nicolai

Makefiles are elegant weapons... for a more civilized age
http://xkcd.com/297/


they work well!
I have just made libliqbase work on x86 with the ones there :)

wannessmet 2010-08-17 12:03

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 :)

norayr 2011-01-08 14:02

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

virusforu 2011-07-08 16:22

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
#inlcude <stdio.h>
main()
{
Printf(“M. Reddi Prasad Reddy,IP University,Delhi”);
}
Note: to save the files click ESC and shift+: and wq! .so that your c program will be saved.
~/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

Joorin 2011-07-08 17:09

Re: On-device development in C/C++?
 
Quote:

Originally Posted by virusforu (Post 1047165)
~/MyDocs/files $ vi hellowrold.c //create a c program by using vi editor

Weird spelling of the file name. Especially as you're trying to compile hello.c later on.

Quote:

Note : for entering any letter you should press “I” to enter in to insert mode
#inlcude <stdio.h>
main()
{
Printf(“M. Reddi Prasad Reddy,IP University,Delhi”);
}
Note: to save the files click ESC and shift+: and wq! .so that your c program will be saved.
It's spelled "include". The function you're looking for is "printf".

ESC leaves insertion mode. The command to save and quit is "wq" by itself and one enters command mode using ":".

Quote:

~/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
Use -o flag to give the generated binary a name.

Quote:

~/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
Why copy the binary to /usr/bin to then run it using ./a.out ?

virusforu 2011-07-08 18:05

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:


| Prev |   6     7   8   9   | Next
All times are GMT. The time now is 08:42.

vBulletin® Version 3.8.8