Search code examples
c++compiler-errorsprotocolsns2

Compilation error while adding mp-olsr on ns 2.34 (Jiazi YI ns 2.29)


I'm trying to add the mp-olsr(ns 2.29) into ns 2.34 and I'm getting some errors while compiling it.

Source code(Jiazi YI): http://www.jiaziyi.com/index.php/research-projects/mp-olsr

Procedure:

$ touch common/packet.cc
$ make

Result:

mpolsr/MPOLSR.o: In function MPOLSR::MPOLSR(int)':
MPOLSR.cc:(.text+0x1457): undefined reference to
Agent::Agent(packet_t)'
mpolsr/MPOLSR.o: In function MPOLSR::MPOLSR(int)':
MPOLSR.cc:(.text+0x16f1): undefined reference to
Agent::Agent(packet_t)'
collect2: ld returned 1 exit status
make: ** [ns] Erro 1

What could I have missed?


Solution

  • In order to solve my error I modified the following in MPOLSR.cc:

    From:

    MPOLSR::MPOLSR(nsaddr_t id) : Agent(PT_MPOLSR),
    hello_timer_(this),
    tc_timer_(this),
    mid_timer_(this) {

    To(everything on a single line):

    MPOLSR::MPOLSR(nsaddr_t id) : Agent(PT_MPOLSR), hello_timer_(this),tc_timer_(this), mid_timer_(this) {

    I know it sounds silly, but it resolved the problem.