EnablingAsserts

From Nsnam
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

A common first "gotcha" in simulation scripts, the following macro must be declared to enable NS3_ASSERT() assertion macros:

  #define NS3_ASSERT_ENABLE

This should happen before core-module.h is included. Note that macros may be defined from the command line in gcc, e.g.:

g++ -Wall -g -DNS3_ASSERT_ENABLE -o foo src/foo.cc -lns3

This is useful to enable/disable NS3_ASSERT() without having to edit any code.