ns3 build failing

141 views
Skip to first unread message

Rima ZOURANE

unread,
May 18, 2023, 2:24:07 PM5/18/23
to ns-3-users
I installed the latest version of ns3 in my vm and the build worked for the first times and now i don't know why but it doesn't seem to work and it gives me this error, could anyone help ?
/usr/bin/ld: ../src/test/CMakeFiles/libtest.dir/ns3tcp/ns3tcp-socket-test-suite.cc.o: in function `Ns3TcpSocketTestCaseCsma::DoRun()':
/home/rima/ns-allinone-3.38/ns-3.38/src/test/ns3tcp/ns3tcp-socket-test-suite.cc:230: undefined reference to `ns3::CsmaHelper::CsmaHelper()'
/usr/bin/ld: /home/rima/ns-allinone-3.38/ns-3.38/src/test/ns3tcp/ns3tcp-socket-test-suite.cc:231: undefined reference to `ns3::CsmaHelper::SetChannelAttribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, ns3::AttributeValue const&)'
/usr/bin/ld: /home/rima/ns-allinone-3.38/ns-3.38/src/test/ns3tcp/ns3tcp-socket-test-suite.cc:232: undefined reference to `ns3::CsmaHelper::SetChannelAttribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, ns3::AttributeValue const&)'
/usr/bin/ld: /home/rima/ns-allinone-3.38/ns-3.38/src/test/ns3tcp/ns3tcp-socket-test-suite.cc:235: undefined reference to `ns3::CsmaHelper::Install(ns3::NodeContainer const&) const'
/usr/bin/ld: ../src/test/CMakeFiles/libtest.dir/ns3tcp/ns3tcp-socket-test-suite.cc.o: in function `ns3::CsmaHelper::~CsmaHelper()':
/home/rima/ns-allinone-3.38/ns-3.38/src/csma/helper/csma-helper.h:56: undefined reference to `vtable for ns3::CsmaHelper'
/usr/bin/ld: /home/rima/ns-allinone-3.38/ns-3.38/src/csma/helper/csma-helper.h:56: undefined reference to `vtable for ns3::CsmaHelper'
/usr/bin/ld: ../src/test/CMakeFiles/libtest.dir/ns3tcp/ns3tcp-socket-test-suite.cc.o: in function `ns3::CsmaHelper::~CsmaHelper()':
/home/rima/ns-allinone-3.38/ns-3.38/src/csma/helper/csma-helper.h:56: undefined reference to `vtable for ns3::CsmaHelper'
/usr/bin/ld: ../src/test/CMakeFiles/libtest.dir/ns3tcp/ns3tcp-socket-test-suite.cc.o: in function `non-virtual thunk to ns3::CsmaHelper::~CsmaHelper()':
/usr/include/c++/11/bits/stl_list.h:499: undefined reference to `vtable for ns3::CsmaHelper'
/usr/bin/ld: ../src/test/CMakeFiles/libtest.dir/ns3tcp/ns3tcp-socket-test-suite.cc.o: in function `ns3::CsmaHelper::~CsmaHelper()':
/home/rima/ns-allinone-3.38/ns-3.38/src/csma/helper/csma-helper.h:56: undefined reference to `vtable for ns3::CsmaHelper'
/usr/bin/ld: ../src/test/CMakeFiles/libtest.dir/ns3tcp/ns3tcp-socket-test-suite.cc.o:/home/rima/ns-allinone-3.38/ns-3.38/src/csma/helper/csma-helper.h:57: more undefined references to `vtable for ns3::CsmaHelper' follow
collect2: error: ld returned 1 exit status
gmake[2]: *** [utils/CMakeFiles/test-runner.dir/build.make:119: ../build/utils/ns3.38-test-runner-default] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:3908: utils/CMakeFiles/test-runner.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
Finished executing the following commands:
cd cmake-cache; /usr/bin/cmake --build . -j 3 ; cd ..

Tom Henderson

unread,
May 18, 2023, 2:38:28 PM5/18/23
to ns-3-...@googlegroups.com, Rima ZOURANE
My quick read of this is that you must be enabling only a subset of
modules and not including 'csma' in that subset, and there is a bug in
the CMakeLists.txt for ns3tcp-socket-test-suite.cc that is only checking
if 'applications' and 'point-to-point' are included, but should also be
checking 'csma'.

The workaround for now is to include 'csma' in the list of enabled
modules, even if you do not need it (it is a small library).

- Tom
> --
> Posting to this group should follow these guidelines
> https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
> <https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting>
> ---
> You received this message because you are subscribed to the Google
> Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ns-3-users+...@googlegroups.com
> <mailto:ns-3-users+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ns-3-users/9bc3ec29-9d12-46af-82b6-33a6c3812b18n%40googlegroups.com <https://groups.google.com/d/msgid/ns-3-users/9bc3ec29-9d12-46af-82b6-33a6c3812b18n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages