1、server.c:1:10: fatal error: net.h: No such file or directory
#include
自己写的.h文件要用“”
2、bind: Socket operation on non-socket
创建时没加括号
3、bind: Cannot assign requested address
不能分配请求的地址,可能是因为ip地址写的不是ubuntu的。
4、client.c:43:6: warning: implicit declaration of function ‘inet_pton’ [-Wimplicit-function-declaration]
if (inet_pton (AF_INET, argv[1], (void *) &sin.sin_addr) != 1) {
没加inet_pton的头文件
5、server.c: In function ‘sig_child_handle’:
server.c:10:3: warning: implicit declaration of function ‘waitpid’; did you mean ‘getpid’? [-Wimplicit-function-declaration]
waitpid(-1, NULL, WNOHANG);
没加头文件