1. 程式人生 > >路由軟體 zebra-0.95a 在linux下面編譯出現問題的解決

路由軟體 zebra-0.95a 在linux下面編譯出現問題的解決

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. /** Added ***/  
  5. #ifdef GNU_LINUX  
  6. #define  __USE_GNU  
  7. #endif  
  8. /**   end added **/  
  9. #ifdef HAVE_NETINET_IN_H  
  10. #include <netinet/in.h>  
  11. #endif /* HAVE_NETINET_IN_H */  
  12. #include <netinet/in_systm.h>  
  13. #include <netinet/ip.h>  
  14. #include <netinet/tcp.h>