Tag Archives: Eclipse

[GUIDE TO] Configuring ns-2.34 with Eclipse Galileo in Ubuntu 12.04

Hi Folks,

In this post I shall explain about how to configure ns-2.34 with Eclipse Galileo. I faced certain problems while configuring ns-2.34 with eclipse as after successful configuration ns-2.34 would compile with errors. This gave me headaches and after lot of working around I found the correct method. So this guide would configure ns-2.34 with eclipse and ns-2.34 would build and compile without giving any errors.

Operating System   : Ubuntu 12.04
Network Simulator v: ns-2.34

Note: Hope u have downloaded and installed ns-allinone-2.34 fixed and patched by me. If you have not u can follow the guide <here>.

First of all in order to run eclipse u need to set up a JAVA environment on your UBUNTU 12.04. Three easy commands in the terminal will set it up for u, if JAVA environment is not present on your Ubuntu.

Open Terminal using Ctrl + Alt + T. And enter the following commands one after the another..

sudo apt-get install openjdk-7-jre
sudo apt-get install openjdk-7-jdk
sudo apt-get install icedtea6-plugin

This setups a Java environment for you.

Step 1) Download Eclipse Galileo (Eclipse IDE for C/C++ developers) from the eclipse website. Or u can download it from <here>.
U also need to download the CDT plugin for Eclipse. U can download it from <here> or from eclipse website.

Step 2) Extract eclipse in the home directory by right clicking on the file eclipse-cpp-galileo-linux-gtk.tar.gz and selecting open with archive manager. Now extract it using the extract button in the home directory. After extraction a directory with the name eclipse should be created in your home directory.

Step 3) Now right click on the file (i.e. the CDT plugin downloaded) cdt-master-6.0.2.zip and select open with archive manager. Now extract it using the extract button on top. Note: When u extract it, extract it inside the eclipse directory created earlier in your home directory and not anywhere else.

Step 4) Now open the eclipse folder and run eclipse. It will ask to select a workspace. Browse to the ns-allinone-2.34 directory in your home folder and select it. U can also make it default and set it to not ask each and every time u start eclipse.

Step 5) After eclipse opens. Browse to File –> New –> C++ Project.

Step 6) A window will open asking u to create a C++ Project. (Now u need to be careful)
In the Project Name field enter ns-2.34. It shall prompt that a directory/project with that name already exists. Ignore it.
Now under the Project Type. Select MakeFile Project.
And Under MakeFile Project. Select Empty Project.
Now Under the ToolChains section (on the right). Select Linux GCC.
And press Next.

Step 7) Now ns-2.34 will be added under your projects listing. To the left of the eclipse window.
Now go to Project –> Build All (It shall build without any errors.)
Now go to Project –> Clean and select ns-2.34 and press OK. (It shall compile without any errors).
Now go to Run –> Run (A % sign should appear on the console below).