OLSR类文件
OLSR.cc
OLSR::link_sensing
(OLSR_msg& msg, const nsaddr_t &receiver_iface, const nsaddr_t &sender_iface, const int &index)
{
OLSR_hello& hello = msg.hello();
double now = CURRENT_TIME;
bool updated = false;
bool created = false;
OLSR_link_tuple* link_tuple = state_.find_link_tuple(sender_iface);
if (link_tuple == NULL)
{
// We have to create a new tuple
link_tuple = new OLSR_link_tuple;
link_tuple->nb_iface_addr() = sender_iface;
link_tuple->local_iface_addr() = receiver_iface;
//For testing only
if(sender_iface == 168427530 && receiver_iface == 169082900 ) //Error occur at this line
{
link_tuple->link_quality_metric() = 0.9;
}
OLSR头文件 OLSR.h
virtual bool link_sensing(OLSR_msg&, const nsaddr_t &, const nsaddr_t &, const int &);
错误获取:说明
在'receiver_iface == 169082900'
答案 0 :(得分:0)
错误信息已清除。
不匹配'运营商=='在' receiver_iface == 169082900'
表示编译器无法理解
中==
的含义
receiver_iface == 169082900
也就是说,它不知道如何比较receiver_iface
和169082900
。
receiver_iface
的类型为nsaddr_t
(无论是什么),169082900
的类型为int
。
因此,您应该在导致错误的代码之前定义以下函数:
bool operator== (const nsaddr_t &left, int right)
{
// whatever you consider appropriate
}