【《Unix网络编程》第一卷第三版|《Unix网络编程》第一卷第三版 源码编译】操作系统:
操作系统: Ubuntu 16.04
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,
^
: recipe for target 'inet_ntop.o' failed
make: *** [inet_ntop.o] Error 1
#define size_t socklen_t
gcc -I../lib -g -O2 -D_REENTRANT -Wall-c -o get_rtaddrs.o get_rtaddrs.c
In file included from get_rtaddrs.c:1:0:
unproute.h:3:45: fatal error: net/if_dl.h: No such file or directory
compilation terminated.
get_rtaddrs.c: In function ‘get_rtaddrs’:
get_rtaddrs.c:21:18: error: ‘RTAX_MAX’ undeclared (first use in this function)
for (i = 0;
i < RTAX_MAX;
i++) {
^
get_rtaddrs.c 中RTAX_MAX变量未声明,在/libroute/unproute.h 加 #define RTAX_MAX 1024
#intro/目录下 启动server
$ make daytimetcpsrv
$ sudo ./daytimetcpsrv
#另起一个terminal,启动client
$ ./daytimetcpcli 127.0.0.1
Fri Mar2 18:51:06 2018