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

痴心易碎 提交于 2019-12-12 03:53:22

问题


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?


回答1:


Before add the new protocol you need to add your protocol name into common/packet.h file after that add your xxx.o \ into Makefile than enter make command in your terminal window..

What you have done is not correct.




回答2:


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.



来源:https://stackoverflow.com/questions/15904571/compilation-error-while-adding-mp-olsr-on-ns-2-34-jiazi-yi-ns-2-29

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!