在Ubuntu上安装NS-3时出错

时间:2017-12-07 12:00:32

标签: ubuntu ns-3

我正在尝试在Ubuntu上安装NS-3。我已经更新并安装了所有必需的软件包,但是当我想要build.py时,会发生此错误:

cc1plus: all warnings being treated as errors
Waf: Leaving directory `/home/ali/Desktop/ns-allinone-3.21/ns-3.21/build'
Build failed
-> task in 'ns3-wave' failed (exit status 1): 
{task 140530495514448: cxx wifi-80211p-helper.cc -> wifi-80211p-
helper.cc.1.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-
error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-
fPIC', '-pthread', '-I.', '-I..', '-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_SQLITE3=1', '-DHAVE_IF_TUN_H=1', '-DHAVE_GSL=1', 
'../src/wave/helper/wifi-80211p-helper.cc', '-c', '-o', 
'src/wave/helper/wifi-80211p-helper.cc.1.o']
Traceback (most recent call last):
File "./build.py", line 170, in <module>
sys.exit(main(sys.argv))
File "./build.py", line 161, in main
build_ns3(config, build_examples, build_tests, args, build_options)
File "./build.py", line 81, in build_ns3
run_command([sys.executable, "waf", "build"] + build_options)
File "/home/ali/Desktop/ns-allinone-3.21/util.py", line 24, in run_command
raise CommandError("Command %r exited with code %i" % (argv, retval))
util.CommandError: Command ['/usr/bin/python', 'waf', 'build'] exited with 
code 1

我该怎么办?请帮助我,这对我来说至关重要。

2 个答案:

答案 0 :(得分:0)

你在建什么系统?尝试使用最新的ns-3.27版本,确保您的系统符合要求(例如gcc / g ++版本)

答案 1 :(得分:0)

在&ns ns-allinone-3.21&#39;目录中构建系统。不在&#ns; ns-3.21&#39;。 Deeplearnning / ns-allinone-3.2 $ ./build 使用手册。 https://www.nsnam.org/doxygen/