在 Ubuntu 18.04.1 LTS 上构建 ns-3 时出错

在 Ubuntu 18.04.1 LTS 上构建 ns-3 时出错

我正在尝试在 ubuntu 18.04 上安装 ns-3。但是当我尝试使用以下命令进行构建时

python ./build.py

并且我有以下错误:

In file included from ./ns3/ptr.h:26:0,
                 from ./ns3/event-id.h:24,
                 from ./ns3/simulator.h:24,
                 from ../src/wimax/model/ss-net-device.cc:23:
../src/wimax/model/ss-net-device.cc: In member function ‘virtual void ns3::SubscriberStationNetDevice::DoReceive(ns3::Ptr<ns3::Packet>)’:
./ns3/assert.h:93:22: error: enum constant in boolean context [-Werror=int-in-bool-context]
       if (!(condition))                               \
                      ^
../src/wimax/model/ss-net-device.cc:926:15: note: in expansion of macro ‘NS_ASSERT_MSG’
               NS_ASSERT_MSG (SS_STATE_WAITING_RNG_RSP,
               ^~~~~~~~~~~~~
./ns3/assert.h:93:22: error: enum constant in boolean context [-Werror=int-in-bool-context]
       if (!(condition))                               \
                      ^
../src/wimax/model/ss-net-device.cc:945:15: note: in expansion of macro ‘NS_ASSERT_MSG’
               NS_ASSERT_MSG (SS_STATE_WAITING_RNG_RSP,
               ^~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

Build failed
 -> task in 'ns3-wimax' failed (exit status 1): 
    {task 139646911565952: cxx ss-net-device.cc -> ss-net-device.cc.1.o}
['/usr/bin/c++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-fPIC', '-pthread', '-I.', '-I..', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_IF_TUN_H=1', '-DHAVE_SQLITE3=1', '../src/wimax/model/ss-net-device.cc', '-c', '-o', 

我该怎么修复它们?

相关内容