Thursday, January 26, 2012

Hello Eclipse

As a developer, you know that the first impression of a development framework is how easy it is to write "Hello, World." with Eclipse CDT as your IDE, because it provides a great plug-in that handles your project creation and management to greatly speed up your development cycles.

Ok, so lets start by opening Eclipse and creating new C++ project.

  • From the eclipse menu create new project, File --> New --> C++ Project
  • In the C++ Project dialog, put Project name as "HelloEclipse" & select Toolchain as "MinGW GCC" & press Finish.

Now we have to create a C++ file for us to write code into.

  • From the eclipse menu create new source file, File --> New --> Source File
  • In the new source file dialog, put the file name "main.cpp" and choose Template as "Default C++ source template" & press Finish.

Now lets put in some code to our source file

#include <iostream>
using namespace std;

int main() {
   cout << "Hello World!\n";
   return 0;
}

Build the project, from Eclipse menu do, Project --> Build All or (Ctrl+B)

No comments:

Post a Comment