路由软件 zebra0.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>  
Meet so Meet. C plusplus I-PLUS....
原文地址:https://www.cnblogs.com/iplus/p/4467340.html