ns3/random-variable.h: No such file or directory

106 views
Skip to first unread message

Durgesh

unread,
Oct 14, 2021, 3:25:53 PM10/14/21
to ns-3-users
HI All,

I am trying to install a module which was developed in NS3 v3.21 on v3.30 but getting below error. Pls let me know how to resolve this error. 

The steps which i tried are:
  1. Clone the 5G VANET repository;

  2. Replace the WiFi module with this new module;

  3. Install two module cgame and cgamemac (the codes are located in src/)

  4. Compile the NS3.21 environment by following command:

    ./waf build

  5. Run the demo and algorithm by following command:

    ./waf --run scratch/graphtheoryGreedy

  6. The simulation results will be saved into a text file.




Error: 
*********************************
In file included from ./ns3/cgamemac-mac-helper.h:26:0,
                 from ./ns3/cgamemac-helper.h:35,
                 from ./ns3/cgamemac-module.h:11,
                 from ../src/cgame/model/cgame-inout-greedy.cc:2:
./ns3/cgamemac-mac.h:29:10: fatal error: ns3/random-variable.h: No such file or directory
 #include "ns3/random-variable.h"
          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

In file included from ./ns3/cgamemac-mac-helper.h:26:0,
                 from ./ns3/cgamemac-helper.h:35,
                 from ./ns3/cgamemac-module.h:11,
                 from ../src/cgame/model/cgame-inout-greedyMergedAnotherGreedy.cc:2:
./ns3/cgamemac-mac.h:29:10: fatal error: ns3/random-variable.h: No such file or directory
 #include "ns3/random-variable.h"
          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Waf: Leaving directory `/home/ubuntu/repos/ns-3-allinone/ns-3.30/build'
Build failed
 -> task in 'ns3-cgame' failed with exit status 1:
        {task 139915963317384: cxx cgame-inout-greedy.cc -> cgame-inout-greedy.cc.1.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-std=c++11', '-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                                    _SQLITE3=1', '-DHAVE_IF_TUN_H=1', '../src/cgame/model/cgame-inout-greedy.cc', '-c', '-o/home/ubuntu/repos/ns-3-allinone/n                                    s-3.30/build/src/cgame/model/cgame-inout-greedy.cc.1.o']
 -> task in 'ns3-cgame' failed with exit status 1:
        {task 139915963317944: cxx cgame-inout-greedyMergedAnotherGreedy.cc -> cgame-inout-greedyMergedAnotherGreedy.cc.1                                    .o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-std=c++11', '-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                                    _SQLITE3=1', '-DHAVE_IF_TUN_H=1', '../src/cgame/model/cgame-inout-greedyMergedAnotherGreedy.cc', '-c', '-o/home/ubuntu/re                                    pos/ns-3-allinone/ns-3.30/build/src/cgame/model/cgame-inout-greedyMergedAnotherGreedy.cc.1.o']

Breno Melo

unread,
Oct 15, 2021, 6:32:52 AM10/15/21
to ns-3-users

Durgesh

unread,
Oct 15, 2021, 8:33:54 AM10/15/21
to ns-3-users
HI - where do i need to add this line. 

Appreciate your help. 

Adil Alsuhaim

unread,
Oct 20, 2021, 7:37:36 PM10/20/21
to ns-3-users
Try changing random-variable.h to random-variable-stream.h because I believe the file name has changed with different in newer releases of ns-3

Cheers,
Adil

Tom Henderson

unread,
Oct 20, 2021, 7:58:44 PM10/20/21
to ns-3-...@googlegroups.com
On 10/20/21 4:37 PM, Adil Alsuhaim wrote:
Try changing random-variable.h to random-variable-stream.h because I believe the file name has changed with different in newer releases of ns-3

This changed as of ns-3.15 release (in 2012).  Also, the variables were changed to inherit from ns3::Object type.

If you want to see what changed (syntax-wise), you can look at the ns-3.14 manual, and compare with a recent release:

https://www.nsnam.org/docs/release/3.14/manual/html/random-variables.html

https://www.nsnam.org/docs/release/3.35/manual/html/random-variables.html

- Tom


Reply all
Reply to author
Forward
0 new messages