Active Topics

 


Reply
Thread Tools
nicholes's Avatar
Posts: 1,103 | Thanked: 368 times | Joined on Oct 2010 @ india, indore
#1
Here i have done a few things on my N900 from

http://ossguy.com/?p=475

to run .cpp files

and when i try to run this using g++ it shows error

here is my programme

# include <stdio.h>
# include <conio.h>
int main (void)
{
printf ("hlloe wolrd");
getch();

}

UPDATE: Thanks to all of you guys i managed to run and also modify .cpp files now (i am using filebox along with the leafpad to edit .cpp)
Attached Images
 
__________________
N900 gave me a reason to live in this cruel world

get your smooth live wallpaper today
My YouTube videos

Last edited by nicholes; 2011-06-26 at 16:01.
 
Captwheeto's Avatar
Posts: 302 | Thanked: 193 times | Joined on Oct 2008 @ England
#2
I've never touched C++ but I have done a little C.
Is there any reason why you're using them headers?
You should only need stdio, like so


#include <stdio.h>

int main(void)
{
printf("hello, world\n");
return 0;
}

unless you were planning to expand. Were you trying to get stdin from the user? I'm Perl/Haskell guy. Sorry I can't be of more help
 

The Following User Says Thank You to Captwheeto For This Useful Post:
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#3
Originally Posted by nicholes View Post
Here i have done a few things on my N900 from

http://ossguy.com/?p=475

to run .cpp files

and when i try to run this using g++ it shows error

here is my programme

# include <stdio.h>
# include <conio.h>
int main (void)
{
printf ("hlloe wolrd");
getch();

}
Any particular reason for not using the QtSDK but go for on-device compile ?
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 

The Following User Says Thank You to attila77 For This Useful Post:
nicholes's Avatar
Posts: 1,103 | Thanked: 368 times | Joined on Oct 2010 @ india, indore
#4
Originally Posted by Captwheeto View Post
I've never touched C++ but I have done a little C.
Is there any reason why you're using them headers?
You should only need stdio, like so


#include <stdio.h>

int main(void)
{
printf("hello, world\n");
return 0;
}

unless you were planning to expand. Were you trying to get stdin from the user? I'm Perl/Haskell guy. Sorry I can't be of more help
i use your methode (using my pc dev c++) but it does nothig a cmd flashes and gone nothing happand

also i am using <conio.h> header file to use getch() for "heelo wolrd" to remain on the screen
__________________
N900 gave me a reason to live in this cruel world

get your smooth live wallpaper today
My YouTube videos
 
nicholes's Avatar
Posts: 1,103 | Thanked: 368 times | Joined on Oct 2010 @ india, indore
#5
Originally Posted by attila77 View Post
Any particular reason for not using the QtSDK but go for on-device compile ?
i am learning in my institute and there is no qtsdk but a very older (turboc++ installed in a pc)

i wont to show them all THE POWER OF N900!
__________________
N900 gave me a reason to live in this cruel world

get your smooth live wallpaper today
My YouTube videos
 

The Following User Says Thank You to nicholes For This Useful Post:
SubCore's Avatar
Posts: 850 | Thanked: 626 times | Joined on Sep 2009 @ Vienna, Austria
#6
you need to tell g++ where to look for conio.h, usually via the -L switch.

but google tells me that conio.h is a very old msdos library, i doubt it'll work in this environment. try something like "cin.get()" (and #include <iostream>)
__________________
"What we perceive is not nature itself, but nature exposed to our method of questioning."
-- Werner Karl Heisenberg
 

The Following 3 Users Say Thank You to SubCore For This Useful Post:
StefanL's Avatar
Posts: 298 | Thanked: 341 times | Joined on Aug 2010 @ This world :)
#7
Originally Posted by nicholes View Post
Here i have done a few things on my N900 from

http://ossguy.com/?p=475

to run .cpp files

and when i try to run this using g++ it shows error

here is my programme

# include <stdio.h>
# include <conio.h>
int main (void)
{
printf ("hlloe wolrd");
getch();

}
Your problem is using a non-standard header file and function (google getch()), this was invented for DOS and only supported by certain compilers. Try using one of the standard input functions and get rid of conio.h if you want to compile it on the N900.
__________________
My phone evolution: Nokia 7610 (RIP), N82 (RIP), BB9000 (RIP), N900, BB9760 (RIP), N8, BB9900, N9 64GB
Working : Python Gorillas (Maemo5) Faircrack0.50 Update (Maemo5)
Not so much : WPScrack (Maemo5)
 

The Following User Says Thank You to StefanL For This Useful Post:
nicholes's Avatar
Posts: 1,103 | Thanked: 368 times | Joined on Oct 2010 @ india, indore
#8
Originally Posted by SubCore View Post
you need to tell g++ where to look for conio.h, usually via the -L switch.

but google tells me that conio.h is a very old msdos library, i doubt it'll work in this environment. try something like "cin.get()" (and #include <iostream>)
i know but my my programme don't work without conio.h (a cmd flashes only)any other method to do this (i am new in coding)
__________________
N900 gave me a reason to live in this cruel world

get your smooth live wallpaper today
My YouTube videos
 
nicholes's Avatar
Posts: 1,103 | Thanked: 368 times | Joined on Oct 2010 @ india, indore
#9
Originally Posted by StefanL View Post
Your problem is using a non-standard header file and function (google getch()), this was invented for DOS and only supported by certain compilers. Try using one of the standard input functions and get rid of conio.h if you want to compile it on the N900.
can you give an example here for me how to get rid of conio.h and getch()?
__________________
N900 gave me a reason to live in this cruel world

get your smooth live wallpaper today
My YouTube videos
 
StefanL's Avatar
Posts: 298 | Thanked: 341 times | Joined on Aug 2010 @ This world :)
#10
Originally Posted by nicholes View Post
can you give an example here for me how to get rid of conio.h and getch()?
Dude, I am not a C programmer, but using googles for getch pops a number of websites with the answer. Sorry can't help you any more (is like the horse and the water thingy).
__________________
My phone evolution: Nokia 7610 (RIP), N82 (RIP), BB9000 (RIP), N900, BB9760 (RIP), N8, BB9900, N9 64GB
Working : Python Gorillas (Maemo5) Faircrack0.50 Update (Maemo5)
Not so much : WPScrack (Maemo5)
 

The Following User Says Thank You to StefanL For This Useful Post:
Reply

Tags
i am sleeping


 
Forum Jump


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