3.0 Preparing Eclipse CDT

Start by downloading Eclipse.

Then unpack it and install the CMake plugins.

This can be done accessing the “Help->Install new software…” eclipse_install_software eclipse_select_cmake_plugins

3.1 Configuring ns-3 with the command line with Eclipse CDT

Configuring the project can be done either directly via CMake or via ns3waf.

For Eclipse we need the -G"Eclipse CDT4 - Unix Makefiles" generator, where -G is the flag that allows us to specify the generator we want to use.

cmake_configure_project

3.2 Opening the project with Eclipse CDT

Click to open the project folder open_project1

Specify the ns-3-dev folder (or whatever you have named it), it will take a while to scan and will show both the top level project and the CMake cache folder. open_project2

The project will open and build targets will be listed on the right while sources are in the left. targets_and_indexer

Auto-completion and other source-code related analysis take a while to begin working, while the C++ indexer runs (look at the bottom right of the window).

3.3 Building targets with Eclipse CDT

Select one of the targets, open the folders until you find a build target for that specific target. The bottom panel will show the build progress.

build_insights

3.4 Running executables with Eclipse CDT

Not sure if I missed something, but for now it is quite laborious to get these working.

First you click to create a new run target. create_run_target

Then you choose the type of the target run_target_type

Then you select the name of the target and path to the binary in ns-3-dev/build/. specify_binary

This is quite bizarre since CLion, Xcode, Visual Studio, Code::Blocks and others do that automatically…

OK, now we select the run target in the dropdown menu on the top left or just click to run/debug and choose later. select_target_to_debug

Now we can set breakpoints and debug. debug_line_by_line

Video covering all steps