linux2.6.36以上安装aodv-uu-0.9.6

5 篇文章 2 订阅

由于Linux内核版本的问题,在2.6.36以上安装aodv-uu-0.9.6会出现以下问题:

gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o main.o main.c
gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o list.o list.c
gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o debug.o debug.c
gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o timer_queue.o timer_queue.c
gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o aodv_socket.o aodv_socket.c
gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o aodv_hello.o aodv_hello.c
gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o aodv_neighbor.o aodv_neighbor.c
gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o aodv_timeout.o aodv_timeout.c
gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o routing_table.o routing_table.c
gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o seek_list.o seek_list.c
gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o aodv_rreq.o aodv_rreq.c
gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o aodv_rrep.o aodv_rrep.c
gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o aodv_rerr.o aodv_rerr.c
gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o nl.o nl.c
In file included from nl.c:38:
lnx/kaodv-netlink.h:89: warning: type defaults to ‘int’ in declaration of ‘DECLARE_MUTEX’
lnx/kaodv-netlink.h:89: warning: parameter names (without types) in function declaration
lnx/kaodv-netlink.h:89: warning: ‘DECLARE_MUTEX’ declared ‘static’ but never defined
gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o locality.o locality.c
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 
make -C /home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx KERNEL_DIR=/lib/modules/2.6.38-8-generic/build KCC=gcc XDEFS=-DDEBUG
make[1]: 正在进入目录 `/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx'
make -C /lib/modules/2.6.38-8-generic/build SUBDIRS=/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx modules
make[2]: 正在进入目录 `/usr/src/linux-headers-2.6.38-8-generic'
  CC [M]  /home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-mod.o
In file included from /home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-mod.c:48:
/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-netlink.h:89: warning: type defaults to ‘int’ in declaration of ‘DECLARE_MUTEX’
/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-netlink.h:89: warning: parameter names (without types) in function declaration
/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-netlink.h:89: warning: ‘DECLARE_MUTEX’ declared ‘static’ but never defined
  CC [M]  /home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-debug.o
In file included from /home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-debug.c:26:
/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-netlink.h:89: warning: type defaults to ‘int’ in declaration of ‘DECLARE_MUTEX’
/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-netlink.h:89: warning: parameter names (without types) in function declaration
/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-netlink.h:89: warning: ‘DECLARE_MUTEX’ declared ‘static’ but never defined
  CC [M]  /home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-netlink.o
In file included from /home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-netlink.c:37:
/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-netlink.h:89: warning: type defaults to ‘int’ in declaration of ‘DECLARE_MUTEX’
/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-netlink.h:89: warning: parameter names (without types) in function declaration
/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-netlink.c:45: warning: type defaults to ‘int’ in declaration of ‘DECLARE_MUTEX’
/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-netlink.c:45: warning: parameter names (without types) in function declaration
/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-netlink.c: In function ‘kaodv_netlink_fini’:
/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-netlink.c:367: error: ‘kaodvnl_sem’ undeclared (first use in this function)
/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-netlink.c:367: error: (Each undeclared identifier is reported only once
/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-netlink.c:367: error: for each function it appears in.)
make[3]: *** [/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx/kaodv-netlink.o] 错误 1
make[2]: *** [_module_/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx] 错误 2
make[2]:正在离开目录 `/usr/src/linux-headers-2.6.38-8-generic'
make[1]: *** [kaodv.ko] 错误 2
make[1]:正在离开目录 `/home/fire/aodv-uu-0.9.6/aodv-uu-0.9.6/lnx'
make: *** [kaodv] 错误 2


查找DECLARE_MUTEX:

在include/linux/semaphore.h 中

将#define DECLARE_MUTEX(name)   改成了 #define DEFINE_SEMAPHORE(name) 

 

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)

DECLARE_MUTEX(led_sem);

#else

DEFINE_SEMAPHORE(led_sem);

#endif


因此将kaodv-netlink.c中

static DECLARE_MUTEX(kaodvnl_sem);

修改为:static DEFINE_SEMAPHORE(kaodvnl_sem);

make clean

make

即可

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值