69,373
社区成员
发帖
与我相关
我的任务
分享
ipnetns.c:5:25: sys/inotify.h: No such file or directory
ipnetns.c: In function `netns_exec':
ipnetns.c:151: warning: implicit declaration of function `unshare'
ipnetns.c:151: error: `CLONE_NEWNS' undeclared (first use in this function)
ipnetns.c:151: error: (Each undeclared identifier is reported only once
ipnetns.c:151: error: for each function it appears in.)
ipnetns.c: In function `netns_monitor':
ipnetns.c:253: warning: implicit declaration of function `inotify_init'
ipnetns.c:259: warning: implicit declaration of function `inotify_add_watch'
ipnetns.c:259: error: `IN_CREATE' undeclared (first use in this function)
ipnetns.c:259: error: `IN_DELETE' undeclared (first use in this function)
ipnetns.c:273: error: dereferencing pointer to incomplete type
ipnetns.c:273: error: dereferencing pointer to incomplete type
ipnetns.c:274: error: dereferencing pointer to incomplete type
ipnetns.c:275: error: dereferencing pointer to incomplete type
ipnetns.c:276: error: dereferencing pointer to incomplete type
ipnetns.c:277: error: dereferencing pointer to incomplete type
make[1]: *** [ipnetns.o] 错误 1
make[1]: Leaving directory `/home/jack/iproute2/iproute2-3.5.0/ip'
make: *** [all] 错误 2
[root@ iproute2-3.5.0]# make
make[1]: Entering directory `/home/jack/iproute2/iproute2-3.5.0/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/jack/iproute2/iproute2-3.5.0/lib'
make[1]: Entering directory `/home/jack/iproute2/iproute2-3.5.0/ip'
mipsel-linux-gcc -Wall -Wstrict-prototypes -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE -c -o ipnetns.o ipnetns.c
mipsel-linux-gcc -Wall -Wstrict-prototypes -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE -c -o rtm_map.o rtm_map.c
*
*省略
*
mipsel-linux-gcc -Wl,-export-dynamic ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o rtm_map.o iptunnel.o ip6tunnel.o tunnel.o ipneigh.o ipntable.o iplink.o ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o iptuntap.o ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o iplink_vlan.o link_veth.o link_gre.o iplink_can.o iplink_macvlan.o iplink_macvtap.o ipl2tp.o ../lib
/libnetlink.a ../lib/libutil.a -lresolv ../lib/libnetlink.a ../lib/libutil.a -ldl -o ip
ipnetns.o: In function `do_netns':ipnetns.c:(.text+0x480): undefined reference to `unshare'
:ipnetns.c:(.text+0x700): undefined reference to `inotify_init'
:ipnetns.c:(.text+0x720): undefined reference to `inotify_add_watch'
collect2: ld returned 1 exit status
make[1]: *** [ip] 错误 1
make[1]: Leaving directory `/home/jack/iproute2/iproute2-3.5.0/ip'
make: *** [all] 错误 2
[root@ iproute2-3.5.0]# vim ip/ipnetns.c