need help for solving errors

196 views
Skip to first unread message

Anjana Bhadra

unread,
Jun 1, 2021, 2:52:07 AM6/1/21
to ns-3-users
hi i am gettin this error while running my code ? can someone tell what i have to change?  code is also given below.


thanks in advance.

ubuntu@ubuntu-virtual-machine:~$ cd ns3
ubuntu@ubuntu-virtual-machine:~/ns3$ cd ns-allinone-3.29
ubuntu@ubuntu-virtual-machine:~/ns3/ns-allinone-3.29$ cd ns-3.29/
ubuntu@ubuntu-virtual-machine:~/ns3/ns-allinone-3.29/ns-3.29$ ./waf --run scratch/latr
Waf: Entering directory `/home/ubuntu/ns3/ns-allinone-3.29/ns-3.29/build'
[2561/2624] Compiling scratch/wireless.cc
[2570/2624] Compiling scratch/latr.cc
../scratch/wireless.cc:27:10: fatal error: ns3/nqos-wifi-mac-helper.h: No such file or directory
   27 | #include "ns3/nqos-wifi-mac-helper.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

../scratch/latr.cc: In function ‘int main(int, char**)’:
../scratch/latr.cc:325:3: error: ‘HtWifiMacHelper’ was not declared in this scope
  325 |   HtWifiMacHelper mac = HtWifiMacHelper::Default ();
      |   ^~~~~~~~~~~~~~~
../scratch/latr.cc:341:3: error: ‘mac’ was not declared in this scope
  341 |   mac.SetType ("ns3::AdhocWifiMac");
      |   ^~~

Waf: Leaving directory `/home/ubuntu/ns3/ns-allinone-3.29/ns-3.29/build'
Build failed
 -> task in 'wireless' failed with exit status 1 (run with -v to display more information)
 -> task in 'latr' failed with exit status 1 (run with -v to display more information)


latr.cc

Juan Antonio Arízaga Silva

unread,
Jun 1, 2021, 7:21:38 PM6/1/21
to ns-3-users
Hi,
#include "ns/nqos-wifi-mac-helper.h"   //Is not used in actual version , you must use  c = WifiMacHelper::Default ();

 // Add a non-QoS upper mac  by default
  WifiMacHelper wifiMac = WifiMacHelper();  //non QoS created by default
  wifiMac.SetType ("ns3::AdhocWifiMac");


Anjana Bhadra

unread,
Jun 2, 2021, 1:17:41 AM6/2/21
to ns-3-users
Sir can you please tell me when I should add c=WifiMacHelper::Default ();

And what should be the header file according to the nqosWifimac

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/c002a6b0-c171-4f42-9a07-bee1022f2ffan%40googlegroups.com.

Juan Antonio Arízaga Silva

unread,
Jun 3, 2021, 3:03:31 PM6/3/21
to ns-3-users
You were told to make the changes in previous messages...
Reply all
Reply to author
Forward
0 new messages