2013-05-29 3 views
-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 '

+1

nsaddr_t은 무엇인가 :

그래서 당신은 오류를 발생시키는 코드 앞에 다음 함수를 정의해야합니까? –

+0

@MartinDrozdik 동등 연산자를 생략하거나 잘못 선언 한 클래스입니다. –

+0

당신은 더 기술적 인 제목을 생각할 수 있습니까? –

답변

0

오류 메시지가 분명합니다.

no match for 'operator==' in 'receiver_iface == 169082900'

수단, 컴파일러는 당신이

입니다
receiver_iface == 169082900 

== 무슨 뜻인지 이해하지 못하는, 그것은 receiver_iface169082900을 비교하는 방법을 알고하지 않습니다.

receiver_ifacensaddr_t (그 무엇이든)이고 169082900int입니다.

bool operator== (const nsaddr_t &left, int right) 
{ 
    // whatever you consider appropriate 
} 
+0

그건 그걸 할 수있는 방법 중 하나입니다 - 또는'nsaddr_t '타입의 어떤 것을 정수로 비교하는 것은 좋은 생각이 아닙니다. –

+0

알겠습니다 감사합니다. –

관련 문제