Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [solved](.cpp)"Hello world" in n900 (getting error) plz guide me.

    Reply
    Page 1 of 4 | 1   2     3   | Next | Last
    nicholes | # 1 | 2011-06-15, 16:20 | Report

    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)

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Images
     

    Last edited by nicholes; 2011-06-26 at 16:01.

     
    Captwheeto | # 2 | 2011-06-15, 16:27 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Captwheeto For This Useful Post:
    nicholes

     
    attila77 | # 3 | 2011-06-15, 16:30 | Report

    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 ?

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to attila77 For This Useful Post:
    nicholes

     
    nicholes | # 4 | 2011-06-15, 16:36 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    nicholes | # 5 | 2011-06-15, 16:39 | Report

    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!

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to nicholes For This Useful Post:
    Helmuth

     
    SubCore | # 6 | 2011-06-15, 16:50 | Report

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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 3 Users Say Thank You to SubCore For This Useful Post:
    marxian, nicholes, nicolai

     
    StefanL | # 7 | 2011-06-15, 16:55 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to StefanL For This Useful Post:
    nicholes

     
    nicholes | # 8 | 2011-06-15, 16:56 | Report

    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)

    Edit | Forward | Quote | Quick Reply | Thanks

     
    nicholes | # 9 | 2011-06-15, 16:58 | Report

    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()?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    StefanL | # 10 | 2011-06-15, 17:01 | Report

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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to StefanL For This Useful Post:
    nicholes

     
    Page 1 of 4 | 1   2     3   | Next | Last
vBulletin® Version 3.8.8
Normal Logout