unix网络编程源码编译出错分析

本文档分析了Unix环境下网络编程源码在编译时遇到的问题,包括在/usr/include/arpa/inet.h第65行缺少size_t前缀的socklen_t参数,解决方法是添加if_dl.h源文件。另外,get_rtaddrs.c中未声明RTAX_MAX变量,需在/libroute/unproute.h中添加#define RTAX_MAX 1024。同时指出struct sockaddr中sa_len变量缺失,是因为系统不支持4.4BSD风格的路由套接字,详细解决方案见README。
摘要由CSDN通过智能技术生成
lin@lin-X555LI:~/Downloads/unix-network-programing/unpv13e/lib$ cd ../libfree
lin@lin-X555LI:~/Downloads/unix-network-programing/unpv13e/libfree$ make
gcc -I../lib -g -O2 -D_REENTRANT -Wall   -c -o in_cksum.o in_cksum.c
gcc -I../lib -g -O2 -D_REENTRANT -Wall   -c -o inet_ntop.o inet_ntop.c
inet_ntop.c: In function ‘inet_ntop’:
inet_ntop.c:60:9: error: argument ‘size’ doesn’t match prototype
  size_t size;
         ^
In file included from inet_ntop.c:27:0:
/usr/include/arpa/inet.h:64:20: error: prototype declaration
 extern const char *inet_ntop (int __af, const void *__restrict __cp,
                    ^
<builtin>: recipe for target 'inet_ntop.o' failed
make: *** [inet_ntop.o] Error 1
lin@lin-X555LI</
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值