路由軟體 zebra-0.95a 在linux下面編譯出現問題的解決
阿新 • • 發佈:2019-02-05
1.問題現象
解壓縮zebra-0.95a壓縮包,編譯,出現問題:
./configure
make
後出現:
Java程式碼
2.解決
開啟zebra-0.95a/lib/zebra.h檔案,
定位到103行,新增如下內容,即可解決。
#ifdef GNU_LINUX
#define __USE_GNU
#endif
=========================
Java程式碼
解壓縮zebra-0.95a壓縮包,編譯,出現問題:
./configure
make
後出現:
Java程式碼
- rtadv.c: In function ‘rtadv_recv_packet’:
- rtadv.c:123: error: dereferencing pointer to incomplete type
- rtadv.c:124: error: dereferencing pointer to incomplete type
-
rtadv.c:124: error: dereferencing pointer to incomplete type
- rtadv.c:130: warning: dereferencing type-punned pointer will break strict-aliasing rules
- rtadv.c: In function ‘rtadv_send_packet’:
- rtadv.c:149: error: invalid application of ‘sizeof’ to incomplete type ‘struct in6_pktinfo’
- rtadv.c:194: warning: operation on ‘node’ may be undefined
-
rtadv.c:268
- rtadv.c:269: error: dereferencing pointer
2.解決
開啟zebra-0.95a/lib/zebra.h檔案,
定位到103行,新增如下內容,即可解決。
#ifdef GNU_LINUX
#define __USE_GNU
#endif
=========================
Java程式碼
- #ifdef HAVE_SYS_SOCKIO_H
- #include <sys/sockio.h>
-
#endif /* HAVE_SYS_SOCKIO_H */
- /** Added ***/
- #ifdef GNU_LINUX
- #define __USE_GNU
- #endif
- /** end added **/
- #ifdef HAVE_NETINET_IN_H
- #include <netinet/in.h>
- #endif /* HAVE_NETINET_IN_H */
- #include <netinet/in_systm.h>
- #include <netinet/ip.h>
- #include <netinet/tcp.h>