路由软件 zebra-0.95a 在linux下面编译出现问题的解决(error: dereferencing pointer to incomplete type)

感谢:http://siwind.iteye.com/blog/1160830,谢谢!
=============================================
1.问题现象  
解压缩zebra-0.95a压缩包,编译,出现问题: 
./configure 
make 

后出现: 

Java代码   收藏代码
  1. rtadv.c: In function ‘rtadv_recv_packet’:  
  2. rtadv.c:123: error: dereferencing pointer to incomplete type  
  3. rtadv.c:124: error: dereferencing pointer to incomplete type  
  4. rtadv.c:124: error: dereferencing pointer to incomplete type  
  5. rtadv.c:130: warning: dereferencing type-punned pointer will break strict-aliasing rules  
  6. rtadv.c: In function ‘rtadv_send_packet’:  
  7. rtadv.c:149: error: invalid application of ‘sizeof’ to incomplete type ‘struct in6_pktinfo’   
  8. rtadv.c:194: warning: operation on ‘node’ may be undefined  
  9. rtadv.c:268: error: dereferencing pointer to incomplete type  
  10. rtadv.c:269: error: dereferencing pointer   



2.解决  
打开zebra-0.95a/lib/zebra.h文件, 
定位到103行,添加如下内容,即可解决。 

#ifdef GNU_LINUX 
#define  __USE_GNU 
#endif
 
========================= 

Java代码   收藏代码
  1. #ifdef HAVE_SYS_SOCKIO_H  
  2. #include <sys/sockio.h>  
  3. #endif /* HAVE_SYS_SOCKIO_H */  
  4.   
  5. /** Added ***/  
  6. #ifdef GNU_LINUX  
  7. #define  __USE_GNU  
  8. #endif  
  9. /**   end added **/  
  10.   
  11. #ifdef HAVE_NETINET_IN_H  
  12. #include <netinet/in.h>  
  13. #endif /* HAVE_NETINET_IN_H */  
  14. #include <netinet/in_systm.h>  
  15. #include <netinet/ip.h>  
  16. #include <netinet/tcp.h>  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值