What do you need?
You have two options. You can write your code, compile, and run it using an Integrated Development Environment (IDE), or you can write your code in your favorite editor and compile it within a terminal. In order to receive the benefits of both options, try them both to see what you like using the most.
You might even want to try programming in a different operating system such as Ubuntu. To figure out how to do that make sure to check out 3 Methods for Installing Ubuntu using Windows.
Should I use an IDE or a plain ‘ol editor and compiler?
Personally, using an IDE is the easiest option. An IDE is a software environment that provides tools and resources to make programming for you easier. An IDE usually contains a source code editor, compiler. and a debugger. It also may have many neat features like auto-complete, syntax highlighting, and can point you to the exact line where the syntax or compile time errors were found. The only downside is that downloading an IDE with a compiler can be a pretty large download (>~75mb).
The other option is to write code in your favorite editor and compile it within a terminal (~10mb to download). This is the path many students in universities are taught in their introductory courses. I learned this way and sometimes prefer it over using an IDE. This method is sometimes more simpler since you don’t need to create an entire project in an IDE to simply write some code out.
Getting started with C++ and an IDE
You can get started writing C++ with an IDE on any platform such as Windows, Linux, and Mac. Below are a list of IDEs you may be interested in. They are ordered in my preference of usage. Make sure you download a version with a compiler.
Eclipse – Windows/Mac/Linux
CodeBlocks – Windows/Mac/Linux
Netbeans – Windows/Mac/Linux
Once you download the IDE, simply create the default C++ project. That should start you with the famous “Hello World” written for you. All you need to do is hit Build & Run and you should see the output in the terminal window like the picture of the IDE above.
Getting started with C++ with a compiler, terminal, and source editor
1. The first step is to download your compiler.
Mac – Correct me if I’m wrong, but you need to download Xcode.
Linux – Using the Synaptic Package Manager or the equivalent, download build-essential.
2. Open up your favorite text editor. For now gedit (Linux) or TextEdit(Mac) is fine. Now copy and paste the following code. Make sure you save it as main.cpp (cpp is the common extension of C++ files).
1 2 3 4 5 6 7 | #include <iostream> using namespace std; int main() { cout << "Hello World!\n"; return 0; } |
3. Open up your terminal, and navigate to main.cpp‘s location. To navigate within a terminal you can use the following commands.
//Change Directory to specified folder cd foldername //Go up one directory cd .. // List contents of directory ls
4. To compile your program, simply type in the following.
g++ main.cpp
5. Now that your program is compiled, run it with the following.
./a.out
6. If done correctly, you should see a “Hello Word” outputted to the terminal!
Overview of C++ Installation
Did you have any problems with any of the steps? Let me know and I’ll address your issue. I am here to help. Once you learn once, you’ll be compiling and running your C++ programs left and right.



