全部博文(404)
分类: LINUX
2009-04-21 15:44:43
SNMP移植问题
哪位高人在ARM平台移植过net-snmp?
请问需要修改的都哪些啊?我改过之后找不到诸如include/linux/route.h这样的头文件,应该怎么处理呢?
先在普通PC上configure出来makefile,然后修改相关的makefile文件的CFLAGS这些参数符合arm平台的要求。
net-snmp-5.2.1.2,出错如下:
arm-linux-gcc -I../../include -I. -I../../agent -I../../agent/mibgroup -I../../snmplib -g -O2 -Dlinux -c mibII/var_route.c -o mibII/var_route.oIn file included from /usr/local/arm-linux/sys-include/net/route.h:28,
from mibII/route_headers.h:93,
from mibII/var_route.c:50:
/usr/local/arm-linux/sys-include/net/dst.h:30: parse error before "atomic_t"
/usr/local/arm-linux/sys-include/net/dst.h:67: parse error before '}' token
/usr/local/arm-linux/sys-include/net/dst.h:77: parse error before "__u32"
/usr/local/arm-linux/sys-include/net/dst.h:85: parse error before "atomic_t"
/usr/local/arm-linux/sys-include/net/dst.h:87: parse error before '}' token
In file included from /usr/local/arm-linux/sys-include/linux/sched.h:18,
from /usr/local/arm-linux/sys-include/net/inetpeer.h:14,
from /usr/local/arm-linux/sys-include/net/route.h:29,
from mibII/route_headers.h:93,
from mibII/var_route.c:50:
/usr/local/arm-linux/sys-include/asm/semaphore.h:18: parse error before "wait_queue_head_t"
/usr/local/arm-linux/sys-include/asm/semaphore.h: In function `sema_init':
/usr/local/arm-linux/sys-include/asm/semaphore.h:47: dereferencing pointer to incomplete type
.......
我编译busybox也这样,只要有route的都出错,难道是编译器的问题?我的是GCC-3.2.3的
不知道这样行不行:先把你的/usr/local/arm-linux/sys-include目录改个名子. 随便给个名字,让编译器认不出来就行了。比如sys-include.old等。
编译通过了,高人啊,能给俺讲一下为什么吗?多谢了!
你的编译器在查找头文件时,先找的sys-include目录,但这个目录主要是内核使用的,所以编译会出问题。屏蔽掉这个目录就行了。