在这段代码中,我遇到了一个与err_sys()
相关的错误:
#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
int main()
{
int sockfd;
if ((sockfd=socket(AF_INET,SOCK_STREAM,0))<0)
err_sys("can't create socket");
close(sockfd);
return 0;
}
我正在遇到连接器错误:
/tmp/cciuUVhz.o: In function `main':
getsockopt.c:(.text+0x38): undefined reference to `err_sys'
collect2: ld returned 1 exit status
< p >函数err_sys()
定义在哪里?< /p >
getsockopt.c
) - Lightness Races in Orbit