|
发表于 2003-12-19 21:57:43
|
显示全部楼层
为什么我不行,出了一大堆的错误?
这是源代码:
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
main()
in_addr_t addr;
addr=inet_addr("211.100.7.101");
printf("%d\n",addr);
}
# gcc -c inet_addr.c
In file included from inet_addr.c:1:
/usr/include/sys/socket.h:52: syntax error before `sa_family_t'
/usr/include/sys/socket.h:52: warning: data definition has no type or storage cl
ass
/usr/include/sys/socket.h:163: syntax error before `u_char'
/usr/include/sys/socket.h:174: syntax error before `u_short'
/usr/include/sys/socket.h:188: syntax error before `u_char'
/usr/include/sys/socket.h:190: `int64_t' undeclared here (not in a function)
/usr/include/sys/socket.h:190: `u_char' undeclared here (not in a function)
/usr/include/sys/socket.h:190: size of array `__ss_pad1' is too large
/usr/include/sys/socket.h:191: syntax error before `int64_t'
/usr/include/sys/socket.h:192: `u_char' undeclared here (not in a function)
/usr/include/sys/socket.h:192: `int64_t' undeclared here (not in a function)
/usr/include/sys/socket.h:192: `u_char' undeclared here (not in a function)
/usr/include/sys/socket.h:192: `int64_t' undeclared here (not in a function)
/usr/include/sys/socket.h:359: syntax error before `pid_t'
/usr/include/sys/socket.h:364: syntax error before `gid_t'
/usr/include/sys/socket.h:399: syntax error before `u_short'
/usr/include/sys/socket.h:407: syntax error before `caddr_t'
/usr/include/sys/socket.h:411: syntax error before `caddr_t'
In file included from inet_addr.c:1:
/usr/include/sys/socket.h:444: syntax error before `recv'
/usr/include/sys/socket.h:444: syntax error before `size_t'
/usr/include/sys/socket.h:444: warning: data definition has no type or storage c
inet_addr.c: In function `main':
inet_addr.c:6: syntax error before `addr' |
|