我正在尝试在 Raspberry pi 上安装 AODV 协议(protocol)。当我尝试执行“make”时,从“https://github.com/erimatnor/aodv-uu”完成 git clone 后,出现以下错误。期待您的建议。谢谢!
make gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY -DDEBUG -o aodvd main.o list.o debug.o timer_queue.o aodv_socket.o aodv_hello.o aodv_neighbor.o aodv_timeout.o routing_table.o seek_list.o aodv_rreq.o aodv_rrep.o aodv_rerr.o nl.o locality.o aodv_neighbor.o: In function
neighbor_add': /home/pi/aodv-uu/aodv_neighbor.c:68: undefined reference to
hello_update_timeout' aodv_timeout.o: In functionroute_discovery_timeout': /home/pi/aodv-uu/aodv_timeout.c:98: undefined reference to
rt_table_update_timeout' aodv_rreq.o: In functionrreq_route_discovery': /home/pi/aodv-uu/aodv_rreq.c:460: undefined reference to
rt_table_update_timeout' aodv_rreq.o: In functionrreq_local_repair': /home/pi/aodv-uu/aodv_rreq.c:521: undefined reference to
rt_table_update_timeout' aodv_rrep.o: In functionrrep_forward': /home/pi/aodv-uu/aodv_rrep.c:231: undefined reference to
rt_table_update_timeout' nl.o: In functionnl_kaodv_callback': /home/pi/aodv-uu/nl.c:282: undefined reference to
rt_table_update_timeout' collect2: error: ld returned 1 exit status Makefile:112: recipe for target 'aodvd' failed make: *** [aodvd] Error 1
最佳答案
sourceforge 上提供的代码与 github 上的代码相同。如果您下载存档,您将看到任何文件的最新修改日期都是 2010 年。鉴于此代码的年龄,我不会惊讶地发现事情根本不再起作用。
但是,这里有一个快速解决您的问题的方法。根本原因似乎是问题函数(如 rt_table_update_timeout )被声明为内联,但该信息似乎在构建过程中的某个地方丢失,以致其他目标文件正在尝试将它们引用为非内联函数。
您可以通过打开 defs.h
查找以下行来避免这种情况:
#define NS_INLINE inline
并将其替换为:
#define NS_INLINE
这将允许aodvd
正确编译(make aodvd
)。在我的系统上,内核模块随后将无法编译:
cc1: fatal error: /lib/modules/4.13.15-100.fc25.x86_64/build/include/linux/modversions.h: No such file or directory
据我所知,现代 Linux 内核不再生成 modversions.h
文件。
关于c - 在 Raspberry pi 上安装 AODV 协议(protocol) (https ://github. com/erimatnor/aodv-uu),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47657744/