![]() |
2011-06-15
, 16:27
|
|
Posts: 302 |
Thanked: 193 times |
Joined on Oct 2008
@ England
|
#2
|
The Following User Says Thank You to Captwheeto For This Useful Post: | ||
![]() |
2011-06-15
, 16:30
|
Posts: 3,319 |
Thanked: 5,610 times |
Joined on Aug 2008
@ Finland
|
#3
|
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();
}
The Following User Says Thank You to attila77 For This Useful Post: | ||
![]() |
2011-06-15
, 16:36
|
|
Posts: 1,103 |
Thanked: 368 times |
Joined on Oct 2010
@ india, indore
|
#4
|
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
![]() |
2011-06-15
, 16:39
|
|
Posts: 1,103 |
Thanked: 368 times |
Joined on Oct 2010
@ india, indore
|
#5
|
Any particular reason for not using the QtSDK but go for on-device compile ?
The Following User Says Thank You to nicholes For This Useful Post: | ||
![]() |
2011-06-15
, 16:50
|
|
Posts: 850 |
Thanked: 626 times |
Joined on Sep 2009
@ Vienna, Austria
|
#6
|
![]() |
2011-06-15
, 16:55
|
|
Posts: 298 |
Thanked: 341 times |
Joined on Aug 2010
@ This world :)
|
#7
|
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();
}
The Following User Says Thank You to StefanL For This Useful Post: | ||
![]() |
2011-06-15
, 16:56
|
|
Posts: 1,103 |
Thanked: 368 times |
Joined on Oct 2010
@ india, indore
|
#8
|
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>)
![]() |
2011-06-15
, 16:58
|
|
Posts: 1,103 |
Thanked: 368 times |
Joined on Oct 2010
@ india, indore
|
#9
|
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.
![]() |
2011-06-15
, 17:01
|
|
Posts: 298 |
Thanked: 341 times |
Joined on Aug 2010
@ This world :)
|
#10
|
can you give an example here for me how to get rid of conio.h and getch()?
The Following User Says Thank You to StefanL For This Useful Post: | ||
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)
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.