有人知道怎么解这个错误吗

Anybody knows how to solve this error?

本文关键字:错误      更新时间:2023-10-16

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 &);

error get: Description
没有匹配'receiver_iface == 169082900'中的'operator=='

错误信息明确

没有匹配'receiver_iface == 169082900'中的'operator=='

表示编译器不理解

中的==是什么意思
receiver_iface == 169082900

也就是说,它不知道如何比较receiver_iface169082900

receiver_ifacensaddr_t类型(不管它是什么),169082900int类型。

因此,应该在导致错误的代码之前定义以下函数:
bool operator== (const nsaddr_t &left, int right)
{
    // whatever you consider appropriate
}