发新话题
打印

求助:一个老问题,关于unpv12e(买书被黑记)

求助:一个老问题,关于unpv12e(买书被黑记)

    虽然我知道不该为这种老问题来耽误前辈们的时间,可是当我从Google搜索相关答案时,看到的都是疑问,而非答案,仅有的几个人提供了所谓“答案”(那是一个网页地址),根本打不开。[/SIZE][/FONT]( K# T9 D2 Q5 ~
    我完全是按照README中所述来安装的,可是make了7个中居然有5个报错![/SIZE][/FONT]
# b! N, R% ~8 {7 J9 o2 G" J& A3 w    下面是我安装的步骤:[/SIZE][/FONT], E0 r! t% X2 c# ^
[/SIZE][/FONT] 2 A8 e- E5 c/ F3 |
cd unpv12e/
1 j2 }* Q- V8 r) X, f' ^ ./configure) M2 N  Q/ I# N! |
   成功[/SIZE][/FONT]
" ?6 V. B. b/ w[/SIZE][/FONT]
- y! e; }& l7 r4 P+ y  g$ r7 y' S8 I cd lib# O- L( Z) Q, z6 Q
make[/SIZE][/FONT]0 N8 w  D! J: h& i
[/SIZE][/FONT]
! `, G6 V; W& N- E, f! s报错:[/COLOR][/SIZE][/FONT]
" g; F; ~& \) K  n% _4 [
复制内容到剪贴板
代码:
gcc -g -O2 -D_REENTRANT -Wall   -c -o connect_nonb.o connect_nonb.c
In file included from connect_nonb.c:1:
unp.h:114: error: redefinition of `struct in_pktinfo'
make: *** [connect_nonb.o] Error 1
[/SIZE][/FONT]5 {0 Q( P+ o) H. h
[/SIZE][/FONT]
; h, Z( B1 E% u4 |9 a5 | cd ../libfree* e! N) k. B8 ?' K
make[/SIZE][/FONT]
/ f! S* D4 A3 }* o2 A% \, i: I   成功[/SIZE][/FONT]' x- |# _$ ^( Y
[/SIZE][/FONT] & l7 s) o* ]3 s/ ?- S" t2 k
4 cd ../libgai
8 E2 ~" c  v1 o4 M0 y2 f8 d make[/SIZE][/FONT]" ^/ p! Y4 [( n: Y8 |
报错:[/COLOR][/SIZE][/FONT]
* d+ d( J4 V1 P2 C
复制内容到剪贴板
代码:
gcc -g -O2 -D_REENTRANT -Wall   -c -o getaddrinfo.o getaddrinfo.c
In file included from gai_hdr.h:1,
                 from getaddrinfo.c:2:
unp.h:114: error: redefinition of `struct in_pktinfo'
make: *** [getaddrinfo.o] Error 1
[/SIZE][/FONT]
6 S" U$ R/ j1 q[/SIZE][/FONT]
) ^" K& j2 c( Q" _$ [) C6 C9 p& a8 s  [ cd ../libroute% U: b- h+ E8 b9 h0 W1 J/ M5 _
make[/SIZE][/FONT]
1 T! ^) d& C8 F- g! ]8 s) }6 q" }6 K' }报错:[/COLOR][/SIZE][/FONT]* }! o2 @5 E# S$ W3 u  f7 C
复制内容到剪贴板
代码:
gcc -g -O2 -D_REENTRANT -Wall   -c -o get_rtaddrs.o get_rtaddrs.c
In file included from unproute.h:1,
                 from get_rtaddrs.c:1:
unp.h:114: error: redefinition of `struct in_pktinfo'
In file included from get_rtaddrs.c:1:
unproute.h:3:45: net/if_dl.h: No such file or directory
get_rtaddrs.c: In function `get_rtaddrs':
get_rtaddrs.c:21: error: `RTAX_MAX' undeclared (first use in this function)
get_rtaddrs.c:21: error: (Each undeclared identifier is reported only once
get_rtaddrs.c:21: error: for each function it appears in.)
get_rtaddrs.c:24: error: structure has no member named `sa_len'
get_rtaddrs.c:24: error: structure has no member named `sa_len'
get_rtaddrs.c:24: error: structure has no member named `sa_len'
get_rtaddrs.c:24: error: structure has no member named `sa_len'
make: *** [get_rtaddrs.o] Error 1
[/SIZE][/FONT]
" o0 m8 o, [! o1 s  b3 V[/SIZE][/FONT]
" S: d% c* G; G cd ../libxti
/ C5 P& U! v/ C6 h" T0 Y7 v+ }$ l make[/SIZE][/FONT]! \0 A# e4 E+ F, d2 K- }
报错:[/COLOR][/SIZE][/FONT]! ^- v1 o  s# Z6 I5 N
复制内容到剪贴板
代码:
gcc -g -O2 -D_REENTRANT -Wall   -c -o wrapxti.o wrapxti.c
In file included from unpxti.h:5,
                 from wrapxti.c:5:
unp.h:114: error: redefinition of `struct in_pktinfo'
In file included from wrapxti.c:5:
unpxti.h:7:17: xti.h: No such file or directory
In file included from wrapxti.c:5:
unpxti.h:102: warning: "struct t_call" declared inside parameter list
unpxti.h:102: warning: its scope is only this definition or declaration, which is probably not what you want
unpxti.h:103: warning: "struct t_bind" declared inside parameter list
unpxti.h:105: warning: "struct t_call" declared inside parameter list
unpxti.h:107: warning: "struct t_bind" declared inside parameter list
unpxti.h:109: warning: "struct t_call" declared inside parameter list
unpxti.h:111: warning: "struct t_info" declared inside parameter list
unpxti.h:112: warning: "struct t_optmgmt" declared inside parameter list
unpxti.h:114: warning: "struct t_discon" declared inside parameter list
unpxti.h:116: warning: "struct t_unitdata" declared inside parameter list
unpxti.h:117: warning: "struct t_uderr" declared inside parameter list
unpxti.h:120: warning: "struct t_unitdata" declared inside parameter list
unpxti.h:122: warning: "struct netbuf" declared inside parameter list
unpxti.h:126: warning: "struct netbuf" declared inside parameter list
unpxti.h:127: warning: "struct netbuf" declared inside parameter list
unpxti.h:131: warning: "struct netbuf" declared inside parameter list
unpxti.h:135: warning: "struct netbuf" declared inside parameter list
unpxti.h:136: warning: "struct netbuf" declared inside parameter list
unpxti.h:140: warning: "struct t_opthdr" declared inside parameter list
unpxti.h:141: warning: "struct t_opthdr" declared inside parameter list
unpxti.h:142: warning: "struct t_opthdr" declared inside parameter list
unpxti.h:143: warning: "struct t_opthdr" declared inside parameter list
unpxti.h:146: warning: "struct t_opthdr" declared inside parameter list
unpxti.h:147: warning: "struct t_opthdr" declared inside parameter list
unpxti.h:148: warning: "struct t_opthdr" declared inside parameter list
unpxti.h:149: warning: "struct t_opthdr" declared inside parameter list
wrapxti.c: In function `err_xti_doit':
wrapxti.c:55: warning: implicit declaration of function `t_strerror'
wrapxti.c:55: error: `t_errno' undeclared (first use in this function)
wrapxti.c:55: error: (Each undeclared identifier is reported only once
wrapxti.c:55: error: for each function it appears in.)
wrapxti.c:55: warning: format argument is not a pointer (arg 4)
wrapxti.c:55: warning: format argument is not a pointer (arg 4)
wrapxti.c:57: error: `TSYSERR' undeclared (first use in this function)
wrapxti.c: At top level:
wrapxti.c:114: warning: "struct t_call" declared inside parameter list
wrapxti.c:115: error: conflicting types for 'T_accept'
unpxti.h:102: error: previous declaration of 'T_accept' was here
wrapxti.c:115: error: conflicting types for 'T_accept'
unpxti.h:102: error: previous declaration of 'T_accept' was here
wrapxti.c: In function `T_accept':
wrapxti.c:118: warning: implicit declaration of function `t_accept'
wrapxti.c: In function `T_alloc':
wrapxti.c:129: warning: implicit declaration of function `t_alloc'
wrapxti.c:129: warning: assignment makes pointer from integer without a cast
wrapxti.c: At top level:
wrapxti.c:135: warning: "struct t_bind" declared inside parameter list
wrapxti.c:136: error: conflicting types for 'T_bind'
unpxti.h:103: error: previous declaration of 'T_bind' was here
wrapxti.c:136: error: conflicting types for 'T_bind'
unpxti.h:103: error: previous declaration of 'T_bind' was here
wrapxti.c: In function `T_bind':
wrapxti.c:137: warning: implicit declaration of function `t_bind'
wrapxti.c: In function `T_close':
wrapxti.c:144: warning: implicit declaration of function `t_close'
wrapxti.c: At top level:
wrapxti.c:149: warning: "struct t_call" declared inside parameter list
wrapxti.c:150: error: conflicting types for 'T_connect'
unpxti.h:105: error: previous declaration of 'T_connect' was here
wrapxti.c:150: error: conflicting types for 'T_connect'
unpxti.h:105: error: previous declaration of 'T_connect' was here
wrapxti.c: In function `T_connect':
wrapxti.c:151: warning: implicit declaration of function `t_connect'
wrapxti.c: In function `T_free':
wrapxti.c:158: warning: implicit declaration of function `t_free'
wrapxti.c: At top level:
wrapxti.c:163: warning: "struct t_bind" declared inside parameter list
wrapxti.c:164: error: conflicting types for 'T_getprotaddr'
unpxti.h:107: error: previous declaration of 'T_getprotaddr' was here
wrapxti.c:164: error: conflicting types for 'T_getprotaddr'
unpxti.h:107: error: previous declaration of 'T_getprotaddr' was here
wrapxti.c: In function `T_getprotaddr':
wrapxti.c:165: warning: implicit declaration of function `t_getprotaddr'
wrapxti.c: In function `T_getstate':
wrapxti.c:174: warning: implicit declaration of function `t_getstate'
wrapxti.c: At top level:
wrapxti.c:181: warning: "struct t_call" declared inside parameter list
wrapxti.c:182: error: conflicting types for 'T_listen'
unpxti.h:109: error: previous declaration of 'T_listen' was here
wrapxti.c:182: error: conflicting types for 'T_listen'
unpxti.h:109: error: previous declaration of 'T_listen' was here
wrapxti.c: In function `T_listen':
wrapxti.c:183: warning: implicit declaration of function `t_listen'
wrapxti.c: In function `T_look':
wrapxti.c:192: warning: implicit declaration of function `t_look'
wrapxti.c: At top level:
wrapxti.c:199: warning: "struct t_info" declared inside parameter list
wrapxti.c:200: error: conflicting types for 'T_open'
unpxti.h:111: error: previous declaration of 'T_open' was here
wrapxti.c:200: error: conflicting types for 'T_open'
unpxti.h:111: error: previous declaration of 'T_open' was here
wrapxti.c: In function `T_open':
wrapxti.c:203: warning: implicit declaration of function `t_open'
wrapxti.c: At top level:
wrapxti.c:210: warning: "struct t_optmgmt" declared inside parameter list
wrapxti.c:211: error: conflicting types for 'T_optmgmt'
unpxti.h:112: error: previous declaration of 'T_optmgmt' was here
wrapxti.c:211: error: conflicting types for 'T_optmgmt'
unpxti.h:112: error: previous declaration of 'T_optmgmt' was here
wrapxti.c: In function `T_optmgmt':
wrapxti.c:212: warning: implicit declaration of function `t_optmgmt'
wrapxti.c: In function `T_rcv':
wrapxti.c:221: warning: implicit declaration of function `t_rcv'
wrapxti.c: At top level:
wrapxti.c:228: warning: "struct t_discon" declared inside parameter list
wrapxti.c:229: error: conflicting types for 'T_rcvdis'
unpxti.h:114: error: previous declaration of 'T_rcvdis' was here
wrapxti.c:229: error: conflicting types for 'T_rcvdis'
unpxti.h:114: error: previous declaration of 'T_rcvdis' was here
wrapxti.c: In function `T_rcvdis':
wrapxti.c:230: warning: implicit declaration of function `t_rcvdis'
wrapxti.c: In function `T_rcvrel':
wrapxti.c:237: warning: implicit declaration of function `t_rcvrel'
wrapxti.c: At top level:
wrapxti.c:242: warning: "struct t_unitdata" declared inside parameter list
wrapxti.c:243: error: conflicting types for 'T_rcvudata'
unpxti.h:116: error: previous declaration of 'T_rcvudata' was here
wrapxti.c:243: error: conflicting types for 'T_rcvudata'
unpxti.h:116: error: previous declaration of 'T_rcvudata' was here
wrapxti.c: In function `T_rcvudata':
wrapxti.c:244: warning: implicit declaration of function `t_rcvudata'
wrapxti.c: At top level:
wrapxti.c:249: warning: "struct t_uderr" declared inside parameter list
wrapxti.c:250: error: conflicting types for 'T_rcvuderr'
unpxti.h:117: error: previous declaration of 'T_rcvuderr' was here
wrapxti.c:250: error: conflicting types for 'T_rcvuderr'
unpxti.h:117: error: previous declaration of 'T_rcvuderr' was here
wrapxti.c: In function `T_rcvuderr':
wrapxti.c:251: warning: implicit declaration of function `t_rcvuderr'
wrapxti.c: In function `T_snd':
wrapxti.c:260: warning: implicit declaration of function `t_snd'
wrapxti.c: In function `T_sndrel':
wrapxti.c:267: warning: implicit declaration of function `t_sndrel'
wrapxti.c: At top level:
wrapxti.c:272: warning: "struct t_unitdata" declared inside parameter list
wrapxti.c:273: error: conflicting types for 'T_sndudata'
unpxti.h:120: error: previous declaration of 'T_sndudata' was here
wrapxti.c:273: error: conflicting types for 'T_sndudata'
unpxti.h:120: error: previous declaration of 'T_sndudata' was here
wrapxti.c: In function `T_sndudata':
wrapxti.c:274: warning: implicit declaration of function `t_sndudata'
wrapxti.c: At top level:
wrapxti.c:310: warning: "struct netbuf" declared inside parameter list
wrapxti.c:311: error: conflicting types for 'Xti_ntop'
unpxti.h:135: error: previous declaration of 'Xti_ntop' was here
wrapxti.c:311: error: conflicting types for 'Xti_ntop'
unpxti.h:135: error: previous declaration of 'Xti_ntop' was here
wrapxti.c: In function `Xti_ntop':
wrapxti.c:314: warning: passing arg 1 of `xti_ntop' from incompatible pointer type
wrapxti.c: At top level:
wrapxti.c:320: warning: "struct netbuf" declared inside parameter list
wrapxti.c:321: error: conflicting types for 'Xti_ntop_host'
unpxti.h:136: error: previous declaration of 'Xti_ntop_host' was here
wrapxti.c:321: error: conflicting types for 'Xti_ntop_host'
unpxti.h:136: error: previous declaration of 'Xti_ntop_host' was here
wrapxti.c: In function `Xti_ntop_host':
wrapxti.c:324: warning: passing arg 1 of `xti_ntop_host' from incompatible pointer type
make: *** [wrapxti.o] Error 1
[/SIZE][/FONT]
9 D% X! s$ n0 z; ?* {: \" m) g[/SIZE][/FONT] 8 {, q) A+ Q- a
cd ../intro
, i5 W' P+ @  e8 e make[/SIZE][/FONT]
1 {0 X, O( W* z3 N报错:[/COLOR][/SIZE][/FONT], H* Z9 S  w* ]0 }# |$ {6 _# E
复制内容到剪贴板
代码:
gcc -g -O2 -D_REENTRANT -Wall   -c -o daytimetcpcli.o daytimetcpcli.c
In file included from daytimetcpcli.c:1:
unp.h:114: error: redefinition of `struct in_pktinfo'
make: *** [daytimetcpcli.o] Error 1
[/SIZE][/FONT]
$ |% d# R4 T& X( w- o小弟最终的感想:这98块钱花得太值了!!2 |0 h+ H# S9 N6 d- d8 N0 \, |
[/SIZE][/FONT]

TOP

小弟用的系统是 红帽子的 AS4

TOP

必须是BSD才能用这个程序吗?
+ z' W; _- I3 ~- P+ B9 {我刚刚用GOOGLE翻译了一下这个网页:: e' U. m; e( k, g' O
[URL]http://www.kegel.com/unpv1/[/URL]: T' q( V# U6 I6 h

" l; [* {# u# N感觉好像是某个让它可以安装于linux的补丁(只是好像,因为英文不好,所以没办法确定)$ b1 n/ }; }) T

( O7 D8 H, D8 d# ?8 N   但google的翻译质量实在让人喷饭,里面满篇的烟焦油、油渍、出口硝石、码头港口、还有粑粑什么的……汗,驴唇不对马嘴……这不过是一个关于《UNIX网络编程》的网页……

TOP

[QUOTE=Zark;568565]我完全是按照README中所述来安装的,可是make了7个中居然有5个报错!
( T, U6 v6 g) }4 g) ~1 _* d... ...+ ?- _$ y* ^7 m3 l* U' j  t, F8 R7 T9 F
小弟最终的感想:这98块钱花得太值了!![/QUOTE]
, @. g" N0 ?; D# i+ s/ `- g- y% sunpv12e 是 98 年出版的, 当时的系统跟现在可能有些差异, 因此不能顺利的 make, 可以理解, 自己稍作修改就能 pass. unpv13e 是 03 年出版的, 情况可能好些, 因此最好还是直接看第三版, 不晓得楼主为什么还买第二版
'
◆ 发帖时请【突出主题】, 以便您的问题能够及时得到回复
◆ 发帖时请将您的【代码】或者【脚本】写在 [code] 和 [/code] 中间

TOP

或者可以看 2e 的书, 用 3e 的 code. 3e 的 code 可以在这里下载: unpbook
'
◆ 发帖时请【突出主题】, 以便您的问题能够及时得到回复
◆ 发帖时请将您的【代码】或者【脚本】写在 [code] 和 [/code] 中间

TOP

发新话题