signetlabdei / lorawan

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

Build failed in the latest ns-3-dev #89

Closed QiuYukang closed 4 years ago

QiuYukang commented 4 years ago

Expected Behavior

'build' finished successfully

Actual Behavior

build failed

[1241/1433] Compiling src/lorawan/model/gateway-lorawan-mac.cc
../src/lorawan/model/gateway-lorawan-mac.cc: In member function ‘virtual void ns3::lorawan::GatewayLorawanMac::Send(ns3::Ptr<ns3::Packet>)’:
../src/lorawan/model/gateway-lorawan-mac.cc:71:84: error: no match for ‘operator>’ (operand types are ‘ns3::Time’ and ‘int’)
   if (m_channelHelper.GetWaitingTime(CreateObject<LogicalLoraChannel> (frequency)) > 0)
                                                                                    ^
../src/lorawan/model/gateway-lorawan-mac.cc:71:84: note: candidates are:
In file included from ./ns3/sub-band.h:26:0,
                 from ./ns3/logical-lora-channel.h:25,
                 from ./ns3/logical-lora-channel-helper.h:25,
                 from ./ns3/lorawan-mac.h:25,
                 from ./ns3/gateway-lorawan-mac.h:24,
                 from ../src/lorawan/model/gateway-lorawan-mac.cc:21:
./ns3/nstime.h:821:1: note: bool ns3::operator>(const ns3::Time&, const ns3::Time&)
 operator > (const Time & lhs, const Time & rhs)
 ^
./ns3/nstime.h:821:1: note:   no known conversion for argument 2 from ‘int’ to ‘const ns3::Time&’
In file included from ./ns3/int64x64.h:30:0,
                 from ./ns3/nstime.h:26,
                 from ./ns3/sub-band.h:26,
                 from ./ns3/logical-lora-channel.h:25,
                 from ./ns3/logical-lora-channel-helper.h:25,
                 from ./ns3/lorawan-mac.h:25,
                 from ./ns3/gateway-lorawan-mac.h:24,
                 from ../src/lorawan/model/gateway-lorawan-mac.cc:21:
./ns3/int64x64-128.h:400:13: note: bool ns3::operator>(const ns3::int64x64_t&, const ns3::int64x64_t&)
 inline bool operator > (const int64x64_t & lhs, const int64x64_t & rhs)
             ^
./ns3/int64x64-128.h:400:13: note:   no known conversion for argument 1 from ‘ns3::Time’ to ‘const ns3::int64x64_t&’
In file included from ./ns3/object.h:27:0,
                 from ./ns3/lorawan-mac.h:24,
                 from ./ns3/gateway-lorawan-mac.h:24,
                 from ../src/lorawan/model/gateway-lorawan-mac.cc:21:
./ns3/ptr.h:485:6: note: template<class T> bool ns3::operator>(const ns3::Ptr<T>&, const ns3::Ptr<T>&)
 bool operator > (const Ptr<T> &lhs, const Ptr<T> &rhs)
      ^
./ns3/ptr.h:485:6: note:   template argument deduction/substitution failed:
../src/lorawan/model/gateway-lorawan-mac.cc:71:86: note:   ‘ns3::Time’ is not derived from ‘const ns3::Ptr<T>’
   if (m_channelHelper.GetWaitingTime(CreateObject<LogicalLoraChannel> (frequency)) > 0)

...

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/src/lorawan
git checkout develop
./waf configure --enable-tests --enable-examples
./waf build

Specifications

DvdMgr commented 4 years ago

Fixed in #90