LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1731|回复: 5

今天下了UNP第一卷的源码,make不通过

[复制链接]
发表于 2004-10-20 11:30:06 | 显示全部楼层 |阅读模式
README里说在i586-pc-linux-gnu (RedHat Linux 4.2)可以通过,
我的是fc1,$cd lib $make时
  1. gcc -g -O2 -D_REENTRANT -Wall   -c -o connect_nonb.o connect_nonb.c
  2. In file included from connect_nonb.c:1:
  3. unp.h:114: error: redefinition of `struct in_pktinfo'
  4. In file included from unp.h:200,
  5.                  from connect_nonb.c:1:
  6. ../lib/addrinfo.h:10: error: redefinition of `struct addrinfo'
  7. In file included from unp.h:200,
  8.                  from connect_nonb.c:1:
  9. ../lib/addrinfo.h:22:1: warning: "AI_PASSIVE" redefined
  10. In file included from unp.h:21,
  11.                  from connect_nonb.c:1:
  12. /usr/include/netdb.h:569:1: warning: this is the location of the previous definition
  13. In file included from unp.h:200,
  14.                  from connect_nonb.c:1:
  15. ../lib/addrinfo.h:23:1: warning: "AI_CANONNAME" redefined
  16. In file included from unp.h:21,
  17.                  from connect_nonb.c:1:
  18. /usr/include/netdb.h:570:1: warning: this is the location of the previous definition
  19. In file included from unp.h:200,
  20.                  from connect_nonb.c:1:
  21. ../lib/addrinfo.h:29:1: warning: "NI_NOFQDN" redefined
  22. In file included from unp.h:21,
  23.                  from connect_nonb.c:1:
  24. /usr/include/netdb.h:602:1: warning: this is the location of the previous definition
  25. In file included from unp.h:200,
  26.                  from connect_nonb.c:1:
  27. ../lib/addrinfo.h:30:1: warning: "NI_NUMERICHOST" redefined
  28. In file included from unp.h:21,
  29.                  from connect_nonb.c:1:
  30. /usr/include/netdb.h:600:1: warning: this is the location of the previous definition
  31. In file included from unp.h:200,
  32.                  from connect_nonb.c:1:
  33. ../lib/addrinfo.h:31:1: warning: "NI_NAMEREQD" redefined
  34. In file included from unp.h:21,
  35.                  from connect_nonb.c:1:
  36. /usr/include/netdb.h:603:1: warning: this is the location of the previous definition
  37. In file included from unp.h:200,
  38.                  from connect_nonb.c:1:
  39. ../lib/addrinfo.h:32:1: warning: "NI_NUMERICSERV" redefined
  40. In file included from unp.h:21,
  41.                  from connect_nonb.c:1:
  42. /usr/include/netdb.h:601:1: warning: this is the location of the previous definition
  43. In file included from unp.h:200,
  44.                  from connect_nonb.c:1:
  45. ../lib/addrinfo.h:36:1: warning: "EAI_ADDRFAMILY" redefined
  46. In file included from unp.h:21,
  47.                  from connect_nonb.c:1:
  48. /usr/include/netdb.h:586:1: warning: this is the location of the previous definition
  49. In file included from unp.h:200,
  50.                  from connect_nonb.c:1:
  51. ../lib/addrinfo.h:37:1: warning: "EAI_AGAIN" redefined
  52. In file included from unp.h:21,
  53.                  from connect_nonb.c:1:
  54. /usr/include/netdb.h:580:1: warning: this is the location of the previous definition
  55. In file included from unp.h:200,
  56.                  from connect_nonb.c:1:
  57. ../lib/addrinfo.h:38:1: warning: "EAI_BADFLAGS" redefined
  58. In file included from unp.h:21,
  59.                  from connect_nonb.c:1:
  60. /usr/include/netdb.h:578:1: warning: this is the location of the previous definition
  61. In file included from unp.h:200,
  62.                  from connect_nonb.c:1:
  63. ../lib/addrinfo.h:39:1: warning: "EAI_FAIL" redefined
  64. In file included from unp.h:21,
  65.                  from connect_nonb.c:1:
  66. /usr/include/netdb.h:581:1: warning: this is the location of the previous definition
  67. In file included from unp.h:200,
  68.                  from connect_nonb.c:1:
  69. ../lib/addrinfo.h:40:1: warning: "EAI_FAMILY" redefined
  70. In file included from unp.h:21,
  71.                  from connect_nonb.c:1:
  72. /usr/include/netdb.h:583:1: warning: this is the location of the previous definition
  73. In file included from unp.h:200,
  74.                  from connect_nonb.c:1:
  75. ../lib/addrinfo.h:41:1: warning: "EAI_MEMORY" redefined
  76. In file included from unp.h:21,
  77.                  from connect_nonb.c:1:
  78. /usr/include/netdb.h:587:1: warning: this is the location of the previous definition
  79. In file included from unp.h:200,
  80.                  from connect_nonb.c:1:
  81. ../lib/addrinfo.h:42:1: warning: "EAI_NODATA" redefined
  82. In file included from unp.h:21,
  83.                  from connect_nonb.c:1:
  84. /usr/include/netdb.h:582:1: warning: this is the location of the previous definition
  85. In file included from unp.h:200,
  86.                  from connect_nonb.c:1:
  87. ../lib/addrinfo.h:43:1: warning: "EAI_NONAME" redefined
  88. In file included from unp.h:21,
  89.                  from connect_nonb.c:1:
  90. /usr/include/netdb.h:579:1: warning: this is the location of the previous definition
  91. In file included from unp.h:200,
  92.                  from connect_nonb.c:1:
  93. ../lib/addrinfo.h:44:1: warning: "EAI_SERVICE" redefined
  94. In file included from unp.h:21,
  95.                  from connect_nonb.c:1:
  96. /usr/include/netdb.h:585:1: warning: this is the location of the previous definition
  97. In file included from unp.h:200,
  98.                  from connect_nonb.c:1:
  99. ../lib/addrinfo.h:45:1: warning: "EAI_SOCKTYPE" redefined
  100. In file included from unp.h:21,
  101.                  from connect_nonb.c:1:
  102. /usr/include/netdb.h:584:1: warning: this is the location of the previous definition
  103. In file included from unp.h:200,
  104.                  from connect_nonb.c:1:
  105. ../lib/addrinfo.h:46:1: warning: "EAI_SYSTEM" redefined
  106. In file included from unp.h:21,
  107.                  from connect_nonb.c:1:
  108. /usr/include/netdb.h:588:1: warning: this is the location of the previous definition
  109. In file included from connect_nonb.c:1:
  110. unp.h:214: error: redefinition of `struct timespec'
  111. unp.h:294: error: conflicting types for `gai_strerror'
  112. /usr/include/netdb.h:620: error: previous declaration of `gai_strerror'
  113. unp.h:298: error: conflicting types for `getnameinfo'
  114. /usr/include/netdb.h:629: error: previous declaration of `getnameinfo'
  115. unp.h:302: error: conflicting types for `gethostname'
  116. /usr/include/unistd.h:783: error: previous declaration of `gethostname'
  117. unp.h:322: error: conflicting types for `inet_aton'
  118. /usr/include/arpa/inet.h:74: error: previous declaration of `inet_aton'
  119. unp.h:415: warning: `struct pollfd' declared inside parameter list
  120. unp.h:415: warning: its scope is only this definition or declaration, which is probably not what you want
  121. make: *** [connect_nonb.o] Error 1
复制代码
发表于 2004-10-20 22:40:57 | 显示全部楼层
unp的代码里有些声明和Linux系统里的头文件重了,注释掉就可以了。
 楼主| 发表于 2004-10-21 19:25:37 | 显示全部楼层
libinary,是unp.h里的声明吗?
发表于 2004-10-21 21:58:39 | 显示全部楼层
出错信息不是告诉你了么,连行号都有
发表于 2006-5-17 17:00:21 | 显示全部楼层
unp的全称叫什么?
回复 支持 反对

使用道具 举报

发表于 2006-5-17 18:16:30 | 显示全部楼层
UNP = Unix Netwrk Programming
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表