- 论坛徽章:
- 0
|
程序简单:
//----------test.c---------
#include <sys/socket.h>;
main()
{
return 0;
}
//-------------------------
gcc -o test test.c编译出错如下:
/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 storag
e class
/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'
<下面的错误消息省略>;
又有如果include了<netinet/in.h>;
就会出现下面的错误:
/usr/include/netinet/in.h:233: syntax error before `in_addr_t'
/usr/include/netinet/in.h:285: syntax error before `u_char'
In file included from /usr/include/netinet/in.h:475,
from test.c:1:
/usr/include/netinet6/in6.h:122: syntax error before `u_int8_t'
/usr/include/netinet6/in6.h:144: syntax error before `u_int8_t'
/usr/include/netinet6/in6.h:149: syntax error before `u_int32_t'
/usr/include/netinet6/in6.h:606: syntax error before `struct'
<下面还有的错误省略>;
请问这是为什么呢?我用FreeBSD5.0Release. 注:在LINUX下是没有出错的. |
|