Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

Is there any software that supports on C or C++ Programming? Then, if it so, how to run, compile or debug your own code to display its output via terminal(linux/ubuntu) or cmd(windows)

share|improve this question

marked as duplicate by karel, i08in, BuZZ-dEE, Avinash Raj, belacqua Mar 6 '14 at 23:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Thanks! I'll check that link! (y) – johndave9296 Mar 6 '14 at 15:39
up vote 1 down vote accepted

you can use g++, a GNU C++ compiler to compile your c/c++ program.

To compile your program type following

g++ -o executable-name yourprogram.cpp

To run the program on terminal type ./executable-name.

However you can use Geany a fast and light-weight IDE to write and compile your c/++ program.

To install Geany open terminal and type:

sudo apt-get install geany.

share|improve this answer

I like using the terminal so I am using Vim as IDE with the package 'build-essential' that contains the compiler and tools for developing C/C++ applications.

If you would like a graphical interface I would suggest Kdevelop. I haven't tried it but it has been marked as a quality IDE by many.

share|improve this answer
I already tried KDevelop however I got problems on compiling/running/debugging it. :( – johndave9296 Mar 6 '14 at 15:38

Sure, here are a few options for you.

GCC - This is probably one of the most popular and widely used compilers that you can use for C/C++. You can work straight from the terminal or add an IDE that also utilizes this package.

Eclipse + CDT - This gives you a C/C++ compiler and an IDE that you can work within. Eclipse is one of the most popular open source IDE's out there and has additional plugins for all kinds of useful things.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.