Ns-3 on Visual Studio 2012

From Nsnam
Revision as of 23:44, 20 September 2013 by Jabraham3 (Talk | contribs)

Jump to: navigation, search

How to download

The ns-3 package is available for download using mercurial using the command below

hg clone http://code.nsnam.org/jabraham3/ns-3-win2

How to build

Open the solution file "ns-3-win2/windows/ns-3-dev/ns-3-dev.sln" using Visual Studio 2012. After all the projects are loaded do the following:

  • From the menu click "Build" --> "Build Solution"

If all goes we should see a build log similar to the below

1>  main.vcxproj -> C:\ws\test\ns-3-win2\windows\ns-3-dev\Debug\main.exe
========== Build: 1 succeeded, 0 failed, 34 up-to-date, 0 skipped ==========

Running the main program

The "main" project is set as the "Startup" project. The "Startup" project contains the program with the 'main' function. The main project is set to run "third.cc". The executable can be run from the command-prompt by

C:\>cd windows\ns-3-dev\Debug
..Debug>main.exe

Changing the main program

To replace the default main program in the "main" project. Do the following: a. Select the "main" project b. Expand the "Source Files" directory c. Right-Click on the existing .cc file, which in a new installation is "third.cc" and select "Remove" d. Right-Click on "Source Files" --> "Add" e. In the popup-menu select "Existing Item" to add an existing source file or select "New Item" to create a new source file.

Adding a new module

Design of the solution