包含了头文件sys/socket.h等,编译链接的时候却报错,是什么问题呢
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <sys/signal.h>
#include <ctype.h>
#include <signal.h>
#include <strings.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
sco unix 5.0.5 下
cc demo.c -o demo
编译的时候报错:
undefined first referenced
symbol in file
recv demo.o
inet_addr demo.o
htons demo.o
socket demo.o
connect demo.o
setsockopt demo.o
是为什么呢,然后解决呢,望各位不吝赐教,谢谢!