Results 1 to 10 of 10

Thread: Compiling and Running C++ in gedit

  1. #1
    Join Date
    Oct 2008
    Beans
    67

    Compiling and Running C++ in gedit

    I am tring to compile and run c++ programs in gedit but so far im having know luck.

    I know there is a way to do this in the terminal but to me this seems ridiculous because with Dev and other compilers all i have to do it go to the task bar,click compile and run the .exe

    My lecturer in college uses Ubuntu and he seems to be able to compile and run the program in a window that pops up but have not managed to ask him and it is important i get this sorted tonight.

    Thank you for any help given.

  2. #2
    Join Date
    Oct 2007
    Location
    London, UK
    Beans
    118
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Compiling and Running C++ in gedit

    using notepad or gedit for any type of programming is very 1990's - i suggest you open a terminal and type in:

    sudo apt-get install monodevelop

    to install an IDE called MonoDevelop. Go to Applications > Programming > MonoDevelop and start a new c++ project. Type in the code then build the project. Voila.

    To compile from the terminal you can use the gcc command or something. I personally have never needed to, being a c# programmer.

    Also, you won't get a .exe but a file without an extension. Exe's are only for windows.
    Last edited by Crandom; October 21st, 2008 at 07:24 PM.

  3. #3
    Join Date
    Oct 2008
    Beans
    67

    Re: Compiling and Running C++ in gedit

    cool so monodevelop will basically cater for what i need?

  4. #4
    Join Date
    Nov 2006
    Beans
    1,134

    Re: Compiling and Running C++ in gedit

    MonoDevelop is an IDE for C# which can also handle C/C++ projects although this is not its main focus. Similarly, Eclipse is an IDE for Java which can also handle C/C++.

    If your main focus is C/C++, try Anjuta.

  5. #5
    Join Date
    Nov 2007
    Beans
    706
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Compiling and Running C++ in gedit

    Quote Originally Posted by Optimus_Jazz View Post
    cool so monodevelop will basically cater for what i need?
    That depends on your specific needs. I suggest trying many different IDE's/editors and see which one you like the most. I prefer Geany for hacking Python and some C, while I favor NetBeans/Eclipse for Java/C++ programming.

    I don't know if MonoDevelop comes with its own compiler and whatnot, but just in case you get tons of errors, you probably need this:

    Code:
    sudo aptitude install build-essential
    Programming is an art. Learn it. Live it. Love it.

  6. #6
    Join Date
    Oct 2008
    Beans
    67

    Re: Compiling and Running C++ in gedit

    I have tried installing these programs and i am either getting errors or they're just too complicated for my liking,so can anybody out there please explain to me how:

    To compile and run C++ programs through gedit, WITHOUT having to enter commands into the terminal.

    I have added an option of "Build" into the tools but when i use it, "No makefile found" is displayed

  7. #7
    Join Date
    Nov 2007
    Beans
    706
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Compiling and Running C++ in gedit

    Quote Originally Posted by Optimus_Jazz View Post
    I have tried installing these programs and i am either getting errors or they're just too complicated for my liking,so can anybody out there please explain to me how:

    To compile and run C++ programs through gedit, WITHOUT having to enter commands into the terminal.

    I have added an option of "Build" into the tools but when i use it, "No makefile found" is displayed
    You can't. Gedit is an editor, not specifically designed for programming. If you install Geany with

    Code:
    sudo aptitude install geany
    then you'll get what you're looking for. It's lightweight, takes only seconds to install. You write the program, SAVE THE FILE (very important), then press F8 to compile, F9 to build, and F5 to run your program. Very simple, very straightforward.
    Programming is an art. Learn it. Live it. Love it.

  8. #8
    Join Date
    Aug 2007
    Location
    Manchester, UK
    Beans
    10,285
    Distro
    Ubuntu

    Re: Compiling and Running C++ in gedit

    Quote Originally Posted by Crandom View Post
    using notepad or gedit for any type of programming is very 1990's
    Not true, I do a lot of coding using vim. I'll either use 2 or 3 terminal tabs (which is more convenient) or if that's not practical, I'll use screen instead.

    Also for C/C++ IDE's I would also recommend geany or anjuta

  9. #9
    Join Date
    Oct 2008
    Beans
    67

    Re: Compiling and Running C++ in gedit

    Quote Originally Posted by Sinkingships7 View Post
    You can't. Gedit is an editor, not specifically designed for programming. If you install Geany with

    Code:
    sudo aptitude install geany
    then you'll get what you're looking for. It's lightweight, takes only seconds to install. You write the program, SAVE THE FILE (very important), then press F8 to compile, F9 to build, and F5 to run your program. Very simple, very straightforward.
    Fantastic,THANK YOU!

  10. #10
    Join Date
    Dec 2009
    Beans
    2

    Re: Compiling and Running C++ in gedit

    Try this Site below. Even though he does it in C I think it's a good start for you.

    http://www.dreamincode.net/forums/topic/63945-game-programming-in-linux-for-windows-programmers-part-1/

    Happy Coding

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
  •