-2

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”中的“operator==”描述不匹配

4

1 回答 1

0

错误信息很清楚。

'receiver_iface == 169082900' 中的 'operator==' 不匹配

意味着,编译器不明白你的==意思

receiver_iface == 169082900

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

receiver_iface是 type nsaddr_t(无论是什么)并且169082900是 type int

因此,您应该在导致错误的代码之前定义以下函数:

bool operator== (const nsaddr_t &left, int right)
{
    // whatever you consider appropriate
}
于 2013-05-29T03:52:57.307 回答