Open wohlbier opened 3 years ago
Dear John,
Thank you for your interest. The code has been written in ns-3.30 and I guess you are running the latest release, ns-3.33. I have just noticed that they removed the 'Default' member in the classes 'ns3::SpectrumWifiPhyHelper' and 'ns3::YansWifiPhyHelper' in release 3.33. Thus, this is the source of the compilation error.
To solve please try this solution: substitute the line
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
with the line
YansWifiPhyHelper wifiPhy;
.
Also substitute the line
SpectrumWifiPhyHelper wifiPhy = SpectrumWifiPhyHelper::Default ();
with the line
SpectrumWifiPhyHelper wifiPhy;
.
Let me know if this solves the error.
Best regards, Matteo
Matteo, thanks for the reply. That does solve that error, but there are more. I guess there would be more work to become compatible with 3.33.
Waf: Entering directory `/srv/scratch/jgwohlbier/ns-3-allinone/ns-3-dev/build'
[2786/2842] Compiling scratch/wifi_1ch.cc
[2789/2842] Compiling scratch/wifi.cc
[2790/2842] Compiling scratch/wifi_dynamic.cc
[2792/2842] Compiling scratch/wifi_static.cc
../scratch/wifi_1ch.cc: In function 'int main(int, char**)':
../scratch/wifi_1ch.cc:253:48: error: 'virtual void ns3::WifiHelper::SetStandard(ns3::WifiPhyStandard)' is deprecated [-Werror=deprecated-declarations]
253 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ac);
| ^
In file included from ./ns3/yans-wifi-helper.h:24,
from ../scratch/wifi_1ch.cc:44:
./ns3/wifi-helper.h:502:16: note: declared here
502 | virtual void SetStandard (WifiPhyStandard standard);
| ^~~~~~~~~~~
../scratch/wifi_1ch.cc:274:23: error: 'WIFI_PHY_STANDARD_80211ax_5GHZ' was not declared in this scope
274 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_5GHZ);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../scratch/wifi_1ch.cc:291:22: error: 'WIFI_PHY_STANDARD_80211ax_2_4GHZ' was not declared in this scope
291 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_2_4GHZ);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../scratch/wifi_1ch.cc:404:20: error: 'static void ns3::BuildingsHelper::MakeMobilityModelConsistent()' is deprecated [-Werror=deprecated-declarations]
404 | BuildingsHelper::MakeMobilityModelConsistent ();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./ns3/buildings-module.h:16,
from ../scratch/wifi_1ch.cc:64:
./ns3/buildings-helper.h:62:15: note: declared here
62 | static void MakeMobilityModelConsistent ();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../scratch/wifi_1ch.cc:404:49: error: 'static void ns3::BuildingsHelper::MakeMobilityModelConsistent()' is deprecated [-Werror=deprecated-declarations]
404 | BuildingsHelper::MakeMobilityModelConsistent ();
| ^
In file included from ./ns3/buildings-module.h:16,
from ../scratch/wifi_1ch.cc:64:
./ns3/buildings-helper.h:62:15: note: declared here
62 | static void MakeMobilityModelConsistent ();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
../scratch/wifi_static.cc: In function 'int main(int, char**)':
../scratch/wifi_static.cc:342:48: error: 'virtual void ns3::WifiHelper::SetStandard(ns3::WifiPhyStandard)' is deprecated [-Werror=deprecated-declarations]
342 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ac);
| ^
In file included from ./ns3/yans-wifi-helper.h:24,
from ../scratch/wifi_static.cc:44:
./ns3/wifi-helper.h:502:16: note: declared here
502 | virtual void SetStandard (WifiPhyStandard standard);
| ^~~~~~~~~~~
../scratch/wifi_static.cc:363:23: error: 'WIFI_PHY_STANDARD_80211ax_5GHZ' was not declared in this scope
363 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_5GHZ);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../scratch/wifi_static.cc:380:22: error: 'WIFI_PHY_STANDARD_80211ax_2_4GHZ' was not declared in this scope
380 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_2_4GHZ);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../scratch/wifi_static.cc:567:20: error: 'static void ns3::BuildingsHelper::MakeMobilityModelConsistent()' is deprecated [-Werror=deprecated-declarations]
567 | BuildingsHelper::MakeMobilityModelConsistent ();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./ns3/buildings-module.h:16,
from ../scratch/wifi_static.cc:64:
./ns3/buildings-helper.h:62:15: note: declared here
62 | static void MakeMobilityModelConsistent ();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../scratch/wifi_static.cc:567:49: error: 'static void ns3::BuildingsHelper::MakeMobilityModelConsistent()' is deprecated [-Werror=deprecated-declarations]
567 | BuildingsHelper::MakeMobilityModelConsistent ();
| ^
In file included from ./ns3/buildings-module.h:16,
from ../scratch/wifi_static.cc:64:
./ns3/buildings-helper.h:62:15: note: declared here
62 | static void MakeMobilityModelConsistent ();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
../scratch/wifi.cc: In function 'int main(int, char**)':
../scratch/wifi.cc:657:48: error: 'virtual void ns3::WifiHelper::SetStandard(ns3::WifiPhyStandard)' is deprecated [-Werror=deprecated-declarations]
657 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ac);
| ^
In file included from ./ns3/yans-wifi-helper.h:24,
from ../scratch/wifi.cc:44:
./ns3/wifi-helper.h:502:16: note: declared here
502 | virtual void SetStandard (WifiPhyStandard standard);
| ^~~~~~~~~~~
../scratch/wifi.cc:678:23: error: 'WIFI_PHY_STANDARD_80211ax_5GHZ' was not declared in this scope
678 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_5GHZ);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../scratch/wifi.cc:695:22: error: 'WIFI_PHY_STANDARD_80211ax_2_4GHZ' was not declared in this scope
695 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_2_4GHZ);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../scratch/wifi.cc:852:20: error: 'static void ns3::BuildingsHelper::MakeMobilityModelConsistent()' is deprecated [-Werror=deprecated-declarations]
852 | BuildingsHelper::MakeMobilityModelConsistent ();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./ns3/buildings-module.h:16,
from ../scratch/wifi.cc:64:
./ns3/buildings-helper.h:62:15: note: declared here
62 | static void MakeMobilityModelConsistent ();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../scratch/wifi.cc:852:49: error: 'static void ns3::BuildingsHelper::MakeMobilityModelConsistent()' is deprecated [-Werror=deprecated-declarations]
852 | BuildingsHelper::MakeMobilityModelConsistent ();
| ^
In file included from ./ns3/buildings-module.h:16,
from ../scratch/wifi.cc:64:
./ns3/buildings-helper.h:62:15: note: declared here
62 | static void MakeMobilityModelConsistent ();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
../scratch/wifi_dynamic.cc: In function 'int main(int, char**)':
../scratch/wifi_dynamic.cc:979:48: error: 'virtual void ns3::WifiHelper::SetStandard(ns3::WifiPhyStandard)' is deprecated [-Werror=deprecated-declarations]
979 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ac);
| ^
In file included from ./ns3/yans-wifi-helper.h:24,
from ../scratch/wifi_dynamic.cc:44:
./ns3/wifi-helper.h:502:16: note: declared here
502 | virtual void SetStandard (WifiPhyStandard standard);
| ^~~~~~~~~~~
../scratch/wifi_dynamic.cc:1000:23: error: 'WIFI_PHY_STANDARD_80211ax_5GHZ' was not declared in this scope
1000 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_5GHZ);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../scratch/wifi_dynamic.cc:1017:22: error: 'WIFI_PHY_STANDARD_80211ax_2_4GHZ' was not declared in this scope
1017 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_2_4GHZ);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../scratch/wifi_dynamic.cc:1174:20: error: 'static void ns3::BuildingsHelper::MakeMobilityModelConsistent()' is deprecated [-Werror=deprecated-declarations]
1174 | BuildingsHelper::MakeMobilityModelConsistent ();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./ns3/buildings-module.h:16,
from ../scratch/wifi_dynamic.cc:64:
./ns3/buildings-helper.h:62:15: note: declared here
62 | static void MakeMobilityModelConsistent ();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../scratch/wifi_dynamic.cc:1174:49: error: 'static void ns3::BuildingsHelper::MakeMobilityModelConsistent()' is deprecated [-Werror=deprecated-declarations]
1174 | BuildingsHelper::MakeMobilityModelConsistent ();
| ^
In file included from ./ns3/buildings-module.h:16,
from ../scratch/wifi_dynamic.cc:64:
./ns3/buildings-helper.h:62:15: note: declared here
62 | static void MakeMobilityModelConsistent ();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
Waf: Leaving directory `/srv/scratch/jgwohlbier/ns-3-allinone/ns-3-dev/build'
Build failed
-> task in 'wifi_1ch' failed with exit status 1 (run with -v to display more information)
-> task in 'wifi_static' failed with exit status 1 (run with -v to display more information)
-> task in 'wifi' failed with exit status 1 (run with -v to display more information)
-> task in 'wifi_dynamic' failed with exit status 1 (run with -v to display more information)
Replace (WIFI_PHY_STANDARD_80211ac) with (WIFI_STANDARD_80211ac) and it should work fine. The WifiHelper::SetStandard (WifiPhyStandard standard) method no longer takes a WifiPhyStandard enum, but instead takes a similarly named WifiStandard enum. If before you specified a value such as WIFI_PHY_STANDARD_xxx, now you must specify WIFI_STANDARD_xxx.
Hi. How I can overcome this error
../scratch/wifi_1ch.cc:404:20: error: 'static void ns3::BuildingsHelper::MakeMobilityModelConsistent()' is deprecated [-Werror=deprecated-declarations]
I am using ns 3.39 please tell me the changes as compare to earlier version of ns3 like what mentioned by sourajitdas and matteonerini
Replace (WIFI_PHY_STANDARD_80211ac) with (WIFI_STANDARD_80211ac) and it should work fine. The WifiHelper::SetStandard (WifiPhyStandard standard) method no longer takes a WifiPhyStandard enum, but instead takes a similarly named WifiStandard enum. If before you specified a value such as WIFI_PHY_STANDARD_xxx, now you must specify WIFI_STANDARD_xxx.
I was also facing this same error from past 2 days, but this simple modification worked for me. Thank you so much!!
Matteo, thanks for the reply. That does solve that error, but there are more. I guess there would be more work to become compatible with 3.33.
Waf: Entering directory `/srv/scratch/jgwohlbier/ns-3-allinone/ns-3-dev/build' [2786/2842] Compiling scratch/wifi_1ch.cc [2789/2842] Compiling scratch/wifi.cc [2790/2842] Compiling scratch/wifi_dynamic.cc [2792/2842] Compiling scratch/wifi_static.cc ../scratch/wifi_1ch.cc: In function 'int main(int, char**)': ../scratch/wifi_1ch.cc:253:48: error: 'virtual void ns3::WifiHelper::SetStandard(ns3::WifiPhyStandard)' is deprecated [-Werror=deprecated-declarations] 253 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ac); | ^ In file included from ./ns3/yans-wifi-helper.h:24, from ../scratch/wifi_1ch.cc:44: ./ns3/wifi-helper.h:502:16: note: declared here 502 | virtual void SetStandard (WifiPhyStandard standard); | ^~~~~~~~~~~ ../scratch/wifi_1ch.cc:274:23: error: 'WIFI_PHY_STANDARD_80211ax_5GHZ' was not declared in this scope 274 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_5GHZ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../scratch/wifi_1ch.cc:291:22: error: 'WIFI_PHY_STANDARD_80211ax_2_4GHZ' was not declared in this scope 291 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_2_4GHZ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../scratch/wifi_1ch.cc:404:20: error: 'static void ns3::BuildingsHelper::MakeMobilityModelConsistent()' is deprecated [-Werror=deprecated-declarations] 404 | BuildingsHelper::MakeMobilityModelConsistent (); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ./ns3/buildings-module.h:16, from ../scratch/wifi_1ch.cc:64: ./ns3/buildings-helper.h:62:15: note: declared here 62 | static void MakeMobilityModelConsistent (); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ../scratch/wifi_1ch.cc:404:49: error: 'static void ns3::BuildingsHelper::MakeMobilityModelConsistent()' is deprecated [-Werror=deprecated-declarations] 404 | BuildingsHelper::MakeMobilityModelConsistent (); | ^ In file included from ./ns3/buildings-module.h:16, from ../scratch/wifi_1ch.cc:64: ./ns3/buildings-helper.h:62:15: note: declared here 62 | static void MakeMobilityModelConsistent (); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors ../scratch/wifi_static.cc: In function 'int main(int, char**)': ../scratch/wifi_static.cc:342:48: error: 'virtual void ns3::WifiHelper::SetStandard(ns3::WifiPhyStandard)' is deprecated [-Werror=deprecated-declarations] 342 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ac); | ^ In file included from ./ns3/yans-wifi-helper.h:24, from ../scratch/wifi_static.cc:44: ./ns3/wifi-helper.h:502:16: note: declared here 502 | virtual void SetStandard (WifiPhyStandard standard); | ^~~~~~~~~~~ ../scratch/wifi_static.cc:363:23: error: 'WIFI_PHY_STANDARD_80211ax_5GHZ' was not declared in this scope 363 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_5GHZ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../scratch/wifi_static.cc:380:22: error: 'WIFI_PHY_STANDARD_80211ax_2_4GHZ' was not declared in this scope 380 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_2_4GHZ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../scratch/wifi_static.cc:567:20: error: 'static void ns3::BuildingsHelper::MakeMobilityModelConsistent()' is deprecated [-Werror=deprecated-declarations] 567 | BuildingsHelper::MakeMobilityModelConsistent (); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ./ns3/buildings-module.h:16, from ../scratch/wifi_static.cc:64: ./ns3/buildings-helper.h:62:15: note: declared here 62 | static void MakeMobilityModelConsistent (); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ../scratch/wifi_static.cc:567:49: error: 'static void ns3::BuildingsHelper::MakeMobilityModelConsistent()' is deprecated [-Werror=deprecated-declarations] 567 | BuildingsHelper::MakeMobilityModelConsistent (); | ^ In file included from ./ns3/buildings-module.h:16, from ../scratch/wifi_static.cc:64: ./ns3/buildings-helper.h:62:15: note: declared here 62 | static void MakeMobilityModelConsistent (); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors ../scratch/wifi.cc: In function 'int main(int, char**)': ../scratch/wifi.cc:657:48: error: 'virtual void ns3::WifiHelper::SetStandard(ns3::WifiPhyStandard)' is deprecated [-Werror=deprecated-declarations] 657 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ac); | ^ In file included from ./ns3/yans-wifi-helper.h:24, from ../scratch/wifi.cc:44: ./ns3/wifi-helper.h:502:16: note: declared here 502 | virtual void SetStandard (WifiPhyStandard standard); | ^~~~~~~~~~~ ../scratch/wifi.cc:678:23: error: 'WIFI_PHY_STANDARD_80211ax_5GHZ' was not declared in this scope 678 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_5GHZ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../scratch/wifi.cc:695:22: error: 'WIFI_PHY_STANDARD_80211ax_2_4GHZ' was not declared in this scope 695 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_2_4GHZ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../scratch/wifi.cc:852:20: error: 'static void ns3::BuildingsHelper::MakeMobilityModelConsistent()' is deprecated [-Werror=deprecated-declarations] 852 | BuildingsHelper::MakeMobilityModelConsistent (); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ./ns3/buildings-module.h:16, from ../scratch/wifi.cc:64: ./ns3/buildings-helper.h:62:15: note: declared here 62 | static void MakeMobilityModelConsistent (); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ../scratch/wifi.cc:852:49: error: 'static void ns3::BuildingsHelper::MakeMobilityModelConsistent()' is deprecated [-Werror=deprecated-declarations] 852 | BuildingsHelper::MakeMobilityModelConsistent (); | ^ In file included from ./ns3/buildings-module.h:16, from ../scratch/wifi.cc:64: ./ns3/buildings-helper.h:62:15: note: declared here 62 | static void MakeMobilityModelConsistent (); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors ../scratch/wifi_dynamic.cc: In function 'int main(int, char**)': ../scratch/wifi_dynamic.cc:979:48: error: 'virtual void ns3::WifiHelper::SetStandard(ns3::WifiPhyStandard)' is deprecated [-Werror=deprecated-declarations] 979 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ac); | ^ In file included from ./ns3/yans-wifi-helper.h:24, from ../scratch/wifi_dynamic.cc:44: ./ns3/wifi-helper.h:502:16: note: declared here 502 | virtual void SetStandard (WifiPhyStandard standard); | ^~~~~~~~~~~ ../scratch/wifi_dynamic.cc:1000:23: error: 'WIFI_PHY_STANDARD_80211ax_5GHZ' was not declared in this scope 1000 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_5GHZ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../scratch/wifi_dynamic.cc:1017:22: error: 'WIFI_PHY_STANDARD_80211ax_2_4GHZ' was not declared in this scope 1017 | wifi.SetStandard (WIFI_PHY_STANDARD_80211ax_2_4GHZ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../scratch/wifi_dynamic.cc:1174:20: error: 'static void ns3::BuildingsHelper::MakeMobilityModelConsistent()' is deprecated [-Werror=deprecated-declarations] 1174 | BuildingsHelper::MakeMobilityModelConsistent (); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ./ns3/buildings-module.h:16, from ../scratch/wifi_dynamic.cc:64: ./ns3/buildings-helper.h:62:15: note: declared here 62 | static void MakeMobilityModelConsistent (); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ../scratch/wifi_dynamic.cc:1174:49: error: 'static void ns3::BuildingsHelper::MakeMobilityModelConsistent()' is deprecated [-Werror=deprecated-declarations] 1174 | BuildingsHelper::MakeMobilityModelConsistent (); | ^ In file included from ./ns3/buildings-module.h:16, from ../scratch/wifi_dynamic.cc:64: ./ns3/buildings-helper.h:62:15: note: declared here 62 | static void MakeMobilityModelConsistent (); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors Waf: Leaving directory `/srv/scratch/jgwohlbier/ns-3-allinone/ns-3-dev/build' Build failed -> task in 'wifi_1ch' failed with exit status 1 (run with -v to display more information) -> task in 'wifi_static' failed with exit status 1 (run with -v to display more information) -> task in 'wifi' failed with exit status 1 (run with -v to display more information) -> task in 'wifi_dynamic' failed with exit status 1 (run with -v to display more information)
heyyy, i'm also using some new version of ns3 and facing problems while running the code , can you please tell me change you did that worked for you to atleast run the code
I am using ns 3.39 please tell me the changes as compare to earlier version of ns3 like what mentioned by sourajitdas and matteonerini
were you able to run the code, if yes, can you please share the list of changes you did to run it in the newer versions of ns3
I think the author should mention ns-3 version in README.