signetlabdei / lorawan

An ns-3 module for simulation of LoRaWAN networks
GNU General Public License v2.0
190 stars 132 forks source link

Build failed on the latest ns-3-dev because of some deprecated methods #83

Closed QiuYukang closed 4 years ago

QiuYukang commented 4 years ago

Expected Behavior

'build' finished successfully

Actual Behavior

build failed error 1

../src/lorawan/model/building-penetration-loss.cc: In member function ‘virtual double ns3::lorawan::BuildingPenetrationLoss::DoCalcRxPower(double, ns3::Ptr<ns3::MobilityModel>, ns3::Ptr<ns3::MobilityModel>) const’:
../src/lorawan/model/building-penetration-loss.cc:73:42: error: ‘bool ns3::MobilityBuildingInfo::IsOutdoor()’ is deprecated (declared at ./ns3/mobility-building-info.h:85) [-Werror=deprecated-declarations]
   if ((b1->IsIndoor () && a1->IsOutdoor ()))
                                          ^
../src/lorawan/model/building-penetration-loss.cc:83:28: error: ‘bool ns3::MobilityBuildingInfo::IsOutdoor()’ is deprecated (declared at ./ns3/mobility-building-info.h:85) [-Werror=deprecated-declarations]
   else if ((b1->IsOutdoor () && a1->IsIndoor ()))
                            ^
../src/lorawan/model/building-penetration-loss.cc:94:27: error: ‘bool ns3::MobilityBuildingInfo::IsOutdoor()’ is deprecated (declared at ./ns3/mobility-building-info.h:85) [-Werror=deprecated-declarations]
   else if (a1->IsOutdoor ()&& b1->IsOutdoor ())
                           ^
../src/lorawan/model/building-penetration-loss.cc:94:46: error: ‘bool ns3::MobilityBuildingInfo::IsOutdoor()’ is deprecated (declared at ./ns3/mobility-building-info.h:85) [-Werror=deprecated-declarations]
   else if (a1->IsOutdoor ()&& b1->IsOutdoor ())
                                              ^
cc1plus: all warnings being treated as errors

error 2

../src/lorawan/examples/complete-network-example.cc: In function ‘int main(int, char**)’:
../src/lorawan/examples/complete-network-example.cc:248:20: error: ‘static void ns3::BuildingsHelper::MakeMobilityModelConsistent()’ is deprecated [-Werror=deprecated-declarations]
   BuildingsHelper::MakeMobilityModelConsistent ();
                    ^
In file included from ../src/lorawan/examples/complete-network-example.cc:27:0:
./ns3/buildings-helper.h:62:15: note: declared here
   static void MakeMobilityModelConsistent ();
               ^
../src/lorawan/examples/complete-network-example.cc:248:49: error: ‘static void ns3::BuildingsHelper::MakeMobilityModelConsistent()’ is deprecated [-Werror=deprecated-declarations]
   BuildingsHelper::MakeMobilityModelConsistent ();
                                                 ^
In file included from ../src/lorawan/examples/complete-network-example.cc:27:0:
./ns3/buildings-helper.h:62:15: note: declared here
   static void MakeMobilityModelConsistent ();
               ^
cc1plus: all warnings being treated as errors

Steps to Reproduce the Problem

git clone https://github.com/nsnam/ns-3-dev-git ns-3
git clone https://github.com/signetlabdei/lorawan ns-3/src/lorawan
cd ns-3
./waf configure --enable-tests --enable-examples
./waf build

Specifications

A possible way to fix it

Refer to this commit in ns-3-dev

DvdMgr commented 4 years ago

Fixed in c1ba48bc1c177070a77a89e68655a7caed459ce1, thank you for pointing this out!