openthread编译错误:error: 'Time' has not been declared static const

编译错误信息:

  CXX      otbr_agent-otubus.o
In file included from ../../third_party/openthread/repo/src/core/thread/key_manager.hpp:45:0,
                 from ../../third_party/openthread/repo/src/core/meshcop/meshcop_tlvs.hpp:54,
                 from ../../third_party/openthread/repo/src/core/thread/network_diagnostic_tlvs.hpp:46,
                 from otubus.cpp:43:
../../third_party/openthread/repo/src/core/common/timer.hpp:77:40: error: 'Time' has not been declared
     static const uint32_t kMaxDelay = (Time::kMaxDuration >> 1);
                                        ^~~~
../../third_party/openthread/repo/src/core/common/timer.hpp:110:5: error: 'Time' does not name a type; did you mean 'Timer'?
     Time GetFireTime(void) const { return mFireTime; }
     ^~~~
     Timer
../../third_party/openthread/repo/src/core/common/timer.hpp:132:52: error: 'Time' has not been declared
     bool DoesFireBefore(const Timer &aSecondTimer, Time aNow);
                                                    ^~~~
../../third_party/openthread/repo/src/core/common/timer.hpp:137:5: error: 'Time' does not name a type; did you mean 'Timer'?
     Time    mFireTime;
     ^~~~
     Timer
../../third_party/openthread/repo/src/core/common/timer.hpp: In constructor 'ot::Timer::Timer(ot::Instance&, ot::Timer::Handler, void*)':
../../third_party/openthread/repo/src/core/common/timer.hpp:99:11: error: class 'ot::Timer' does not have any field named 'mFireTime'
         , mFireTime()
           ^~~~~~~~~
../../third_party/openthread/repo/src/core/common/timer.hpp: At global scope:
../../third_party/openthread/repo/src/core/common/timer.hpp:176:18: error: 'TimeMilli' has not been declared
     void StartAt(TimeMilli sStartTime, uint32_t aDelay);
                  ^~~~~~~~~
../../third_party/openthread/repo/src/core/common/timer.hpp:190:12: error: 'TimeMilli' does not name a type; did you mean 'TimerMilli'?
     static TimeMilli GetNow(void) { return TimeMilli(otPlatAlarmMilliGetNow()); }
            ^~~~~~~~~
            TimerMilli
Makefile:848: recipe for target 'otbr_agent-otubus.o' failed

发现openthread/third_party/openthread/repo/src/core/thread/network_diagnostic_tlvs.hpp文件中包含#include "meshcop/meshcop_tlvs.hpp"且没有使用;

发现openthread/third_party/openthread/repo/src/core/meshcop/meshcop_tlvs.hpp文件中递归包含common/timer.hpp造成编译错误;

解决方法:
删除或屏蔽openthread/third_party/openthread/repo/src/core/thread/network_diagnostic_tlvs.hpp文件中的#include "meshcop/meshcop_tlvs.hpp

编译成功。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值