DEEPAK MALIK
DEEPAK MALIK

Reputation: 15

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.

When i try to run it with -

./waf --run scratch/wifi-dl-ofdma (no extension required for c++ file)

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.

Upvotes: 0

Views: 8377

Answers (2)

Sagar
Sagar

Reputation: 1870

First, if you can, switch to the most recent release version of 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. As of the writing of this answer, the most recent release is 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.

Upvotes: 1

a4arshad
a4arshad

Reputation: 604

Since you have not mentioned the ns3 and gcc versions. 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. I fixed this issue with the following commands:

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

You can find details on this link

Upvotes: 3

Related Questions