editing ns3 programs in eclipse

1,887 views
Skip to first unread message

flower smell

unread,
Feb 4, 2012, 2:35:00 AM2/4/12
to ns-3-users
Hi everyone,

I am using Eclipse IDE for C/C++ Developers SR2 Galileo 3.5.2 and I
configured it to build and run ns3 programs using waf as nsnam.org
posted in this link (https://www.nsnam.org/wiki/index.php/
HOWTO_configure_eclipse_with_ns-3). But, I have problem editing the
program in Eclipse, that is it gave me a syntax error when I write as
an example : #include "ns3/core-module.h" or any other modules include
and "Unresolved inclusion: "ns3/aodv-module.h" " message appeared. I
don't know if the Eclipse checks for program syntax instantly or
not ?

Thank you,

Vedran Miletić

unread,
Feb 4, 2012, 4:17:13 AM2/4/12
to ns-3-...@googlegroups.com
2012/2/4 flower smell <flower...@gmail.com>:

Hi,

have you done the steps under "Configure Debugger"?

Vedran

Yeison Camargo

unread,
Feb 4, 2012, 10:01:20 AM2/4/12
to ns-3-...@googlegroups.com
Hi Flower,

Try to save the program (ctr+s) and then check if the error still appears, if that did not resolve the problem try this includes (I'm working on ubuntu and i have it working like a charm):

includes.png



--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.




--
YEISON JULIAN CAMARGO
Cisco Systems CCNA
Cisco Systems CCNA Security
Microsoft MTA Windows Server Administration
Microsoft MTA Security
Microsoft MTA Networking
IPv6 Hurricane Electric SAGE

includes.png

flower smell

unread,
Feb 5, 2012, 5:21:06 AM2/5/12
to ns-3-users

Hi Verdan, Hi Yeison, Hi ns3 users,

Thank you very much for your help.

In fact, I am a new user of ns3 and eclipse ( I used to use
netbeans ), I think I have a problem in configuring Mercurial step,
because when I saw your screenshot --Yeison, I noticed the difference
very clearly where all the folders and files inside the ns-3-dev
repository are shown in the project explorer tree ( at the left of the
eclipse window ). But, with mine, just the includes tree and the c++
file is shown. (Please see my eclipse screenshot
http://www.4shared.com/photo/YUA9B4u2/Screenshot.html)

I want to tell you what I did in each step of of this post
http://www.nsnam.org/wiki/index.php/HOWTO_configure_eclipse_with_ns-3
:

1- In the few first steps of configuring Mercurial, I installed
eclipse IDE for C/C++ developers Galileo 3.5.2 SR2, Mercurial,and
Mercurial eclipse plugin into eclipse. (EXACTLY As they said in the
post)

2- I am concerned about this step of configuring Mercurial and I don't
know if it was correct :

( start eclipse, it will a workspace directory NB:It is advised to use
a different directory for the code say ~/src )

I used a different directory and named it ( work_space) and ran the
command
(ns3@flowersmell:~/work_space$ hg clone http://code.nsnam.org/ns-3-dev
ns-3-dev). THen, I selected in eclipse ( file--> New--> C++ project)
and (project name= newtest , Location = /home/ns3/work_space/ns-3-dev/
newtest, project type =Executable Empty)

Then right click on the project -->team-->share project --> select
Mercurial and Next--> a pop menu telling me this message ("An existing
Mercurial repository was found in the parent directory. Please choose
which repository should be connected with the project.")
I typed ("/home/ns3/work_space/ns-3-dev") in the text box and finish

3. I did the step of "Configure Waf Builder" as is written in the post
(except I put /home/ns3/work_space/ns-3-dev/waf instead of $
{workspace_loc:ns-3-dev}/waf in the build command) and (/home/ns3/
work_space/ns-3-dev instead of ${workspace_loc:ns-3-dev}). By the way,
the screenshots in the post is with different entries than the text
instructions!!!!!!!!.

4. In the step of "Configure Debugger", I chose my project
name("newtest") in the debug configurations. But I don't know what to
put in the c++ application name field ( I know that I should use the c+
+ file in the scratch folder, but how can I make this c++ file as a
part of my project?). The rest of this step configurations is done
easily.

5. The last step I did is "Configure External Runner" without
Configure Runner.

When I click on build the following results are shown :

**** Build of configuration Default for project newtest ****

/home/ns3/work_space/ns-3-dev/waf build
Waf: Entering directory `/home/ns3/work_space/ns-3-dev/build'
Waf: Leaving directory `/home/ns3/work_space/ns-3-dev/build'
'build' finished successfully (1.213s)

Modules built:
aodv applications
bridge
config-store core
csma
csma-layout dsdv
emu
energy flow-monitor
internet
lte mesh
mobility
mpi netanim
network
nix-vector-routing olsr point-to-
point
point-to-point-layout propagation
spectrum
stats tap-bridge
test
tools topology-read
uan
virtual-net-device visualizer
wifi
wimax

Modules not built:
click openflow


I am sorry for this long message, but I am confused at the start of my
thesis which is about MANET protocols and I want to start as early as
possible in simulating with MANET.

Thank you very much and I am eagerly waiting for your reply.

Ahmed
Message has been deleted
Message has been deleted

Yeison Camargo

unread,
Feb 5, 2012, 9:32:46 PM2/5/12
to ns-3-...@googlegroups.com
Yes, but the answer?

On Sun, Feb 5, 2012 at 9:31 PM, flower smell <flower...@gmail.com> wrote:

Please, I really want help

Thank you,


--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.

flower smell

unread,
Feb 6, 2012, 12:53:49 AM2/6/12
to ns-3-users
Hi Yeison,
Hi everyone,

Yeison, I am sorry, but I didn't understand your question "Yes, but
the answer?" Anyway, finally I configured Eclipse with the right
configurations and it is working well now, except one thing the
"Configure Debugger" step. I have no "debug directory" under the
"build directory". So, when I select Environment tab in the debug
configurations and then define new variable with name=
LD_LIBRARY_PATH, I can't put ${workspace_loc:ns-3-dev/build/debug} in
the value text box, because I don't have the debug directory in the
build directory as I said before. Whenever I try to select as an
example ${workspace_loc:ns-3-dev/build} , a popup window appeared with
this message:

'Launching ns-3-dev Debug' has encountered a problem
Variable references non-existent resource : ${workspace_loc:ns-3-dev/
build}

Waiting for help,

Thank you,

Ahmed

Yeison Camargo

unread,
Feb 6, 2012, 2:23:08 PM2/6/12
to ns-3-...@googlegroups.com
Hi, One question: your name is Flower or Ahmed?, I don't what to say: Hi Flower or Hi Ahmed.

Anyway, if you check the mail i wrote this:
Hi, flower, Ahmed??
I'm checking your mail, but in need you to answer one question, Which version of Ubuntu are you using??? 10.04?????
So in the second mail i wrote: Yes, but the answer?? it means the answer to the question Which version of Ubuntu are you using??? 
It is nice to hear that you already have it working, Now about debuggin there are some other things to do in order to make it work (but don't worry i will tell you exactly what you have to do):

The first thing about I have no "debug directory" under the "build directory" . That's because in the last ns-3 version the waf version has been changed, then, some folders have changed a little bit. I will show you an image about the configuration you need to set up.

In the next image there is something really important that you need to set up, Do you see the blue link that says: Select other (at the end of the image)? You need to set it as the image shows, i mean: Using GDB (DSF) Create Process Launcher, by default it is set to 

debug1.png
--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.

debug1.png

Yeison Camargo

unread,
Feb 6, 2012, 2:38:45 PM2/6/12
to ns-3-...@googlegroups.com
Hi, One question: your name is Flower or Ahmed?, I don't what to say: Hi Flower or Hi Ahmed.

Anyway, if you check the mail i wrote this:
Hi, flower, Ahmed??
I'm checking your mail, but in need you to answer one question, Which version of Ubuntu are you using??? 10.04?????
So in the second mail i wrote: Yes, but the answer?? it means the answer to the question Which version of Ubuntu are you using??? 
It is nice to hear that you already have it working, Now about debuggin there are some other things to do in order to make it work (but don't worry i will tell you exactly what you have to do):

The first thing about I have no "debug directory" under the "build directory" . That's because in the last ns-3 version the waf version has been changed, then, some folders have changed a little bit. I will show you an image about the configuration you need to set up.

In the next image there is something really important that you need to set up, Do you see the blue link that says: Select other (at the end of the image)? You need to set it as the image shows, i mean: Using GDB (DSF) Create Process Launcher, by default it is set to Using Standard Create Process Launcher so you need to change it as the image show, click on Select other and choose the one i show you in the image. (In the image i'm configuring the debbuger to work with a script called myfirst, it means I copied in the scratch folder an run it, it automatically create the file in the build/scratch/myfirst, but you need to set it with you own script)
Second thing, if you see, when you choose GDB (DSF) the environment tab disappears don't worry about it, what you need to do is to check that the Debugger has been set as the second image shows. 
Now, if you click in the Debug button, you will get the error : error while loading shared libraries: libns3-aodv.so.3: cannot open shared object file: No such file or directory, in order to fix it you will need to check in the mailing list an email that i wrote, the subject is: 

NS-3.13 DEBUGGING WORKING WITH ECLIPSE!!!!!!!! (UBUNTU 11.10)

But to make you the thing easier, this is the email: 

After following ns3 wiki instructions about configure debugger i got the error:  
"error while loading shared libraries: libns3-aodv.so.3: cannot open shared object file: No such file or directory"
Searching in the Internet I could solve it!!!!! I just had to create some symbolic links. Now i have ns-3.13 working perfect in eclipse.
The symbolic links are (It could be useful for someone):
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-aodv.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-dsdv.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-mesh.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-test.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-csma-layout.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-point-to-point-layout.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-netanim.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-olsr.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-csma.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-lte.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-wimax.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-spectrum.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-applications.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-virtual-net-device.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-uan.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-energy.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-flow-monitor.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-nix-vector-routing.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-tap-bridge.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-visualizer.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-internet.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-bridge.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-point-to-point.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-mpi.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-wifi.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-propagation.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-mobility.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-config-store.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-tools.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-emu.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-stats.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-topology-read.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-network.so.3 /usr/lib/
sudo ln -s /home/X/workspace/ns-3-allinone/ns-3.13/build/libns3-core.so.3 /usr/lib/
If any question do not hesitate to write.

I hope this works for you, if you have any question please write. 


debug1.png

debug2.png
debug1.png
debug2.png

flower smell

unread,
Feb 6, 2012, 9:54:54 PM2/6/12
to ns-3-users

Hi Yeison,

My name is Ahmed and I wrote "flower smell" just as a nickname. Sorry,
I didn't see your email, only the reply here. the debug configurations
are corrected. I made a mistake with the LD Library path and now it is
working. But, I want to make a new External tool configuration to run
pyviz whenever I execute my simulation program (with --vis option) in
Eclipse. So, I made a the same External tool configuration execpt for
the Argument, I put (--run "${string_prompt}" --vis). but pyviz didn't
work. So, I tried to check it through the terminal from the directory /
home/ns3/work_space/ns-3-dev , the same thing (not working). Then I
typed ./waf configure in the same directory, and I saw that the python
bindings are not enabled with(PyBindGen version not correct and newer
version could not be retrieved). So, I tried with : bzr checkout -
rrevno:795 https://launchpad.net/pybindgen pybindgen ,but the
following error appeared : bzr: ERROR: File exists: u'/home/ns3/
work_space/ns-3-dev/pybindgen/.bzr': [Errno 17] File exists: '/home/
ns3/work_space/ns-3-dev/pybindgen/.bzr'.

I solved the python bindings error in the original ns3 directory (I
mean ns-3-allinone/ns-3.13) by running the download.py command in the
ns-3-allinone directory, but here in the repository inside the
work_space folder, we have no download.py file. So, how can I enable
the python bindings ?

Ahmed

flower smell

unread,
Feb 7, 2012, 1:09:03 AM2/7/12
to ns-3-users
I forgot to answer, I am using Ubuntu 10.04 LTS
Reply all
Reply to author
Forward
0 new messages