YansWifiPhyHelper Error

335 views
Skip to first unread message

Jayden

unread,
Apr 4, 2022, 5:03:59 AM4/4/22
to ns-3-users
Hi guys, I am using Ubuntu 20.04 and NS3.35. 
When I am running the ./build.py, it shows the error below. May I know the problem of this issue?

../scratch/manet-routing-compare.cc: In member function ‘void RoutingExperiment::Run(int, double, std::string)’:
../scratch/manet-routing-compare.cc:255:21: error: cannot convert ‘ns3::WifiPhyStandard’ to ‘ns3::WifiStandard’
  255 |   wifi.SetStandard (WIFI_PHY_STANDARD_80211b);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
      |                     |
      |                     ns3::WifiPhyStandard
In file included from ./ns3/yans-wifi-helper.h:24,
                 from ../scratch/manet-routing-compare.cc:79:
./ns3/wifi-helper.h:475:42: note:   initializing argument 1 of ‘virtual void ns3::WifiHelper::SetStandard(ns3::WifiStandard)’
  475 |   virtual void SetStandard (WifiStandard standard);
      |                             ~~~~~~~~~~~~~^~~~~~~~
../scratch/manet-routing-compare.cc:257:51: error: ‘Default’ is not a member of ‘ns3::YansWifiPhyHelper’
  257 |   YansWifiPhyHelper wifiPhy =  YansWifiPhyHelper::Default ();
      |                                                   ^~~~~~~

Waf: Leaving directory `/home/tan/Desktop/test/ns-allinone-3.35/ns-3.35/build'
Build failed
 -> task in 'manet-routing-compare' failed with exit status 1 (run with -v to display more information)
Traceback (most recent call last):
  File "./build.py", line 175, in <module>
    sys.exit(main(sys.argv))
  File "./build.py", line 166, in main
    build_ns3(config, build_examples, build_tests, args, build_options)
  File "./build.py", line 86, in build_ns3
    run_command([sys.executable, "waf", "build"] + build_options)
  File "/home/tan/Desktop/test/ns-allinone-3.35/util.py", line 25, in run_command
    raise CommandError("Command %r exited with code %i" % (argv, retval))
util.CommandError: Command ['/usr/bin/python3', 'waf', 'build'] exited with code 1

Tom Henderson

unread,
Apr 4, 2022, 8:29:16 PM4/4/22
to ns-3-...@googlegroups.com
On 4/4/22 02:03, Jayden wrote:
> Hi guys, I am using Ubuntu 20.04 and NS3.35.
> When I am running the ./build.py, it shows the error below. May I know
> the problem of this issue?
>
> ../scratch/manet-routing-compare.cc: In member function ‘void
> RoutingExperiment::Run(int, double, std::string)’:
> ../scratch/manet-routing-compare.cc:255:21: error: cannot convert
> ‘ns3::WifiPhyStandard’ to ‘ns3::WifiStandard’
>   255 |   wifi.SetStandard (WIFI_PHY_STANDARD_80211b);

It looks like you are running ns-3.35 but with a program in scratch/
directory (manet-routing-compare.cc) that is from an earlier release.

For ns-3.35, you would do:

WifiHelper wifi;
wifi.SetStandard (WIFI_STANDARD_80211b);

- Tom

Jayden

unread,
Apr 5, 2022, 5:15:26 AM4/5/22
to ns-3-users
Hi Tom,
Thank you so much for yr help. Very appreciate it.

Syed Muhammad Adnan

unread,
Apr 7, 2022, 4:34:18 AM4/7/22
to ns-3-...@googlegroups.com
I got an error for manet-routing-compare.cc in ns3.35 when run through gdb that showed this type of error.
Program received signal SIGFPE, Arithmetic exception.
0x000055555557aea4 in ns3::operator/<unsigned int> (lhs=..., rhs=0)
    at ./ns3/nstime.h:1075
1075  return Time(lhs.m_data / rhs);
(gdb) bt
#0  0x000055555557aea4 in ns3::operator/<unsigned int> (lhs=..., rhs=0)
    at ./ns3/nstime.h:1075
#1  0x00005555555751c2 in RoutingExperiment::Run (this=0x7fffffffdbc0,
    nSinks=10, txp=7.5, CSVfileName="AODV.csv") at ../scratch/22.cc:446
#2  0x0000555555571f03 in main (argc=1, argv=0x7fffffffdf48)
    at ../scratch/22.cc:225

--
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/ed337f8c-0370-c54f-3180-5884f658aadd%40tomh.org.
Reply all
Reply to author
Forward
0 new messages