Eclipse is one of my favorite programming environment which is used to develop C, C++ and/or Java software efficiently. Let's set up Eclipse so that we can use it to work with MinGW C/C++ compiler and Java.
- First, install MinGW (as shown in this post). You have two choices for the MinGW compiler:
- MinGW (www.mingw.org)
The original GCC toolchain for 32-bit Windows only - MinGW-w64 (mingw-w64.sourceforge.net)
New breed of tools that allow you to compile for both 32-bit and 64-bit Windows
I prefer the original MinGW compiler to MinGW-w64, but individual tastes may vary. Make sure that you add the folder containing gcc.exe to the PATH environment variable.
- MinGW (www.mingw.org)
Then, install JRE because Eclipse won't run without it. If you want to develop Java, then install JDK (Java SE or Java EE) instead of JRE.
Now, download Eclipse IDE for C/C++ Developers (eclipse-cpp-juno-win32.zip) and unpack it. You need it to develop C/C++ programs.
If you also want to develop Java, then download Eclipse IDE for Java Developers (eclipse-java-juno-win32.zip). Just unpack the Java Developer package into the same folder as Eclipse for C/C++, avoiding to overwrite existing files.
Create a shortcut on your desktop that points to the Eclipse program (eclipse.exe). To start Eclipse, double-click the Eclipse shortcut that you just created.
Let's test our Eclipse installation and create a simple C++ program. Start a new C++ project (File->New->C++ Project). Type in any Project name, and select Empty Project under Executable Project types. Choose MinGW GCC for toolchains. Click Finish.
Once a new C++ project is open, create a new source file (File->New->Source File).
Try typing in a simple code like the following:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, boys and girls.\n";
return 0;
}Save the project (File->Save). Build the project (Project->Build Project). If the build was successful, run the generated program (Run->Run, or Ctrl+F11).
No comments:
Post a Comment