简体   繁体   English

在退出状态为 1 的 ns3 中构建错误:

[英]Building error in ns3 with exit status 1:

After installing ns3 succesfully i tried to compile it again with a new file(wifi-dl-ofdma.cc) in the scratch folder.成功安装 ns3 后,我尝试使用暂存文件夹中的新文件(wifi-dl-ofdma.cc)再次编译它。

When i try to run it with -当我尝试运行它时 -

./waf --run scratch/wifi-dl-ofdma (no extension required for c++ file) ./waf --run scratch/wifi-dl-ofdma (c++ 文件不需要扩展名)

Build terminate with this-构建终止于此 -

**Build failed
 -> task in 'wifi-dl-ofdma' failed (exit status 1): 
    {task 139886228468752: cxx wifi-dl-ofdma.cc -> wifi-dl-ofdma.cc.3.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-std=c++11', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-pthread', '-I.', '-I..', '-I/usr/include/gtk-2.0', '-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include', '-I/usr/include/gio-unix-2.0', '-I/usr/include/cairo', '-I/usr/include/pango-1.0', '-I/usr/include/atk-1.0', '-I/usr/include/pixman-1', '-I/usr/include/libpng12', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/harfbuzz', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/freetype2', '-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_GTK2=1', '../scratch/wifi-dl-ofdma.cc', '-c', '-o', '/home/deepak/ns-allinone-3.27/ns-3.27/build/scratch/wifi-dl-ofdma.cc.3.o']**

I am not able to undernstand the error.我无法理解错误。

Since you have not mentioned the ns3 and gcc versions.由于您没有提到 ns3 和 gcc 版本。 I've had the same issue earlier when I was trying to build an old version of ns3 (ns3.26 on Ubuntu 18) with new gcc compiler.早些时候,当我尝试使用新的 gcc 编译器构建旧版本的 ns3(Ubuntu 18 上的 ns3.26)时,我遇到了同样的问题。 I fixed this issue with the following commands:我使用以下命令修复了这个问题:

CXXFLAGS="-Wall" ./waf configure
./waf -vv

You can find details on this link您可以在此链接上找到详细信息

First, if you can, switch to the most recent release version of ns-3.首先,如果可以,请切换到 ns-3 的最新发行版。 There are bugs in old releases, some of which are platform dependent.旧版本中存在错误,其中一些是平台相关的。 For example , there was a bug in ns-3.29 that prevented compiling on macOS Mojave.例如,ns-3.29 中存在一个错误,无法在 macOS Mojave 上进行编译。 As of the writing of this answer, the most recent release is ns-3.30.1 .在撰写此答案时,最新版本是ns-3.30.1

If you must use the old version, just rebuild your project.如果您必须使用旧版本,只需重建您的项目。 Sometimes, "stuff happens" and it's probably not worth debugging what the problem is on an old version.有时,“事情发生了”,可能不值得在旧版本上调试问题所在。 In this situation, it may be best to just start afresh.在这种情况下,最好重新开始。 Run

./waf clean
./waf --build-profile=debug --enable-examples --enable-tests configure

then try to re-run your program.然后尝试重新运行您的程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM