[color=blue]1.问题现象[/color]
解压缩zebra-0.95a压缩包,编译,出现问题:
./configure
make
后出现:
[color=blue]2.解决[/color]
打开zebra-0.95a/lib/zebra.h文件,
定位到103行,添加如下内容,即可解决。
[color=blue]#ifdef GNU_LINUX
#define __USE_GNU
#endif[/color]
=========================
解压缩zebra-0.95a压缩包,编译,出现问题:
./configure
make
后出现:
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: error: dereferencing pointer to incomplete type
rtadv.c:269: error: dereferencing pointer [color=blue]2.解决[/color]
打开zebra-0.95a/lib/zebra.h文件,
定位到103行,添加如下内容,即可解决。
[color=blue]#ifdef GNU_LINUX
#define __USE_GNU
#endif[/color]
=========================
#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>
本文详细介绍了如何解决使用zebra-0.95a压缩包编译时遇到的rtadv.c文件中关于类型不完整和类型punned pointer的错误。通过在zebra.h文件中添加特定的预定义宏,成功解决了编译问题。本教程适用于对zebra路由选择软件进行编译和配置的开发者。
163

被折叠的 条评论
为什么被折叠?



