Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: C ide

  1. #1
    Join Date
    Sep 2012
    Beans
    57

    Post C ide

    I have Ubuntu 12.04, I'm new using it so please be patient to explain.

    I've installed Ajunta, Eclipse, Code:Blocks, KDevelop, Geany and I run a "Hello World" program and no one work like Windows IDE's.

    I run "Hello world!" program in Geany it runs well, but if I run a larger code program it has this error. Note that when I compile, Geany doesn't show me errors.

    Here's the code if needed, it's a multiplicator.

    Code:
    #include <stdio.h> 
     
    int main() 
    { 
          int st, nd, result; 
           
          printf("Enter the first number "); 
          scanf("%d", &st); 
          printf("Enter the second number "); 
          scanf("%d", &nd); 
          result = st * nd; 
          printf("The result of your multiplication is %d", result); 
          getchar(); 
          getchar(); 
    }
    Error in Geany is attached.

    Feel free if you want to share a better IDE for C or C++.

    Thank you!
    Attached Images Attached Images

  2. #2
    Join Date
    Jun 2011
    Location
    United Kingdom
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: C ide

    I've installed Ajunta, Eclipse, Code:Blocks, KDevelop, Geany and I run a "Hello World" program and no one work like Windows IDE's.
    Are you expecting them to be? Visual Studio is good, but a complete nightmare if you don't follow its use-case.

    I run "Hello world!" program in Geany it runs well, but if I run a larger code program it has this error. Note that when I compile, Geany doesn't show me errors.
    You're trying to execute the wrong file. Go to the Build->Set build commands and that should help. Although if I recall, both Anjuta and Code::Blocks do this fine. Geany doesn't really seem to be intended as an IDE, more as a text editor with some handy development features, which it does very well.

    Feel free if you want to share a better IDE for C or C++.
    The ones you've tried are what we have. You probably just need to spend a little time figuring them out, as you no doubt did for the MS IDEs.

  3. #3
    Join Date
    Nov 2008
    Location
    Earth
    Beans
    76
    Distro
    Ubuntu Development Release

    Re: C ide

    Quote Originally Posted by manudo View Post

    Code:
    #include <stdio.h> 
     
    int main() 
    { 
          int st, nd, result; 
           
          printf("Enter the first number "); 
          scanf("%d", &st); 
          printf("Enter the second number "); 
          scanf("%d", &nd); 
          result = st * nd; 
          printf("The result of your multiplication is %d", result); 
          getchar(); 
          getchar(); 
    }
    Error in Geany is attached.
    The screenshot show you compile using g++ not gcc..
    This code is for C or C++ programming??

    I compile using geany with no problem.. just got warning because you dont put return 0...

  4. #4
    Join Date
    Dec 2008
    Beans
    69

    Re: C ide

    You can try netbean with c++, but I think you need reinstall compile packages first
    Last edited by tienlbhoc; September 16th, 2012 at 10:56 AM.

  5. #5
    Join Date
    Sep 2012
    Beans
    57

    Re: C ide

    Quote Originally Posted by MG&TL View Post
    You're trying to execute the wrong file. Go to the Build->Set build commands and that should help.
    Yeah, but. What I have to do in the Set Build Commands box, I mean, what I have to do right there?

    By the way, I'm trying Anjuta.

    Quote Originally Posted by safarin View Post
    The screenshot show you compile using g++ not gcc..
    This code is for C or C++ programming??

    I compile using geany with no problem.. just got warning because you dont put return 0...
    Yeah, I don't see a big difference between C and C++, and even if I put return 0; Geany returns that error.
    Last edited by manudo; September 16th, 2012 at 06:21 PM.

  6. #6
    Join Date
    Jun 2011
    Location
    United Kingdom
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: C ide

    Quote Originally Posted by manudo View Post
    Yeah, but. What I have to do in the Set Build Commands box, I mean, what I have to do right there?

    By the way, I'm trying Anjuta.
    Erm...the command to execute your binary. I don't really know what you're asking, sorry. If you don't know how to build and run executables in Linux, you're probably barking up the wrong tree with an IDE, at least IMO. Learn to manually compile things, then you can use an IDE if you wish.

    Anjuta is probably more up your street. It has a more Visual Studio feel, with Projects and whatnot.

    Yeah, I don't see a big difference between C and C++, and even if I put return 0; Geany returns that error.
    EDIT: Uh-oh. Refer my earlier comment about IDEs- they just complicate things for new developers. My advice is not to use one, and just to use a simple text editor until you get the hang of stuff.
    Last edited by MG&TL; September 16th, 2012 at 06:25 PM.

  7. #7
    Join Date
    Sep 2012
    Beans
    57

    Re: C ide

    Quote Originally Posted by MG&TL View Post
    Erm...the command to execute your binary. I don't really know what you're asking, sorry.
    Doesn't matter, I've tried Anjuta and finally I understand it. I use terminal to check the executables, but If I double-click it in the explorer it doesn't show me nothing, what's happening?

    Quote Originally Posted by MG&TL View Post
    EDIT: Uh-oh. Refer my earlier comment about IDEs- they just complicate things for new developers. My advice is not to use one, and just to use a simple text editor until you get the hang of stuff.
    Yeah, sometimes I use gedit and compile with gcc, but I use IDE's because there are some errors in terminal that I can't understand.
    Last edited by manudo; September 16th, 2012 at 07:06 PM.

  8. #8
    Join Date
    Jun 2011
    Location
    United Kingdom
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: C ide

    Quote Originally Posted by manudo View Post
    Doesn't matter, I've tried Anjuta and finally I understand it. I use terminal to check the executables, but If I double-click it in the explorer it doesn't show me nothing, what's happening?



    Yeah, sometimes I use gedit and compile with gcc, but I use IDE's because there are some errors in terminal that I can't understand.
    Okay, whatever works for you.

    For some reason unknown to me, nautilus ("explorer") won't run executables, even if they're graphical. So yeah, it's a terminal job.

    My apologies, I kind of assumed you were having basic problems, not IDE problems.


    Problem with that is that you'll get the exact same errors in an IDE. So I'm not sure what you mean by that.

  9. #9
    Join Date
    Sep 2012
    Beans
    57

    Re: C ide

    IDE's tells you where is the expected part, or simply where is the error. It's easier to me.

    Thank you by the way!

  10. #10
    Join Date
    Jun 2011
    Location
    United Kingdom
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: C ide

    Quote Originally Posted by manudo View Post
    IDE's tells you where is the expected part, or simply where is the error. It's easier to me.

    Thank you by the way!
    So does gcc.

    Not a problem.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •