NS-3: undefined reference to `ns3::AnimationInterface::AnimationInterface

Suppose you're modifying code in `ns-3/examples/`

Locate `CMakeLists.txt` of your example code; e.g. mine's locate at `ns-3/examples/tcp/CMakeLists.txt`.

Add `${libnetanim}` to LIBRARIES_TO_LINK.

build_example(
NAME tcp-star-server
SOURCE_FILES tcp-star-server.cc
LIBRARIES_TO_LINK
${libpoint-to-point}
${libapplications}
${libinternet}
)

becomes

build_example(
NAME tcp-large-transfer
SOURCE_FILES tcp-large-transfer.cc
LIBRARIES_TO_LINK
${libpoint-to-point}
${libapplications}
${libinternet}
${libnetanim}
)


Old document only says `Add 'netanim' to your wscript`. This is how you solve it.

Comments