After installing and compiling the successful NS3 under Ubuntu, consider using the integrated development environment eclipse, considering that the development work is really inconvenient at the command line.
A related configuration scheme is given on the Nsnam website, and after reading, the following steps are summarized as follows:
PS: If the NS3 is recommended to install first, otherwise there will be many other problems.
1. Download the eclipse environment, and if you don't have the JDK installed, you'll need to download the JRE and put it in the Eclipse directory so that Eclipse works. In addition, since NS3 is developed in pure C + +, it is recommended to download the C + + version of Eclipse directly.
2. Import NS3 into Eclipse, in fact, NS3 is not detected by Eclipse as a C + + project, so we need to copy the contents of NS3 directly into the new empty project under Eclipse, and then we can see the related things.
3. Build configuration of the above works. The main points include the following:
3.1 project->property->c/c++ Build->build setting
3.1.1 Do not select Use default Build command and generate makefile automatically
3.1.2 fills in the build command with ${workspace_loc:ns-dev-path}/waf, where Workspace_loc represents the workspace path of Eclipse and writes directly. But Ns-dev-path refers to the path to the WAF in your NS3 project, which needs to be modified according to its own circumstances.
3.1.3 In build directory ${workspace_loc:ns-dev-path}/build, the same path set as above, just replaced by build.
3.2 project->property->c/c++ Build->behavior
3.2.1 Change all of the build to build.
4. Debug setup for the project, for debugging purposes. In fact, this step is equivalent to setting up a running module.
4.1 Run->run configure->c/c++ Application
4.1.1 Add a application (right-click)
4.1.2 Run->run configure->c/c++ Application->main
Set the project and application path, the general project is given, the application can be found through search, if not found, you need to manually enter the path. Remember, the application path here refers to the compiled section, which is usually under build.
4.1.3 Run->run configure->c/c++ application->environment
Here need to set Ld_library_path, system settings if wrong, will be prompted to find the relevant files, so need to reset. Depending on the file that is prompted by the console, search should be found in the project and the path will be replaced.
5. After Setup is complete, apply, run. It is possible to experiment with first under the Scatch.
PS:: The fourth step in fact there are many other settings, online a lot of references, not a narrative.
Debugging NS3 with Eclipse