发新话题
打印

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

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

    虽然我知道不该为这种老问题来耽误前辈们的时间,可是当我从Google搜索相关答案时,看到的都是疑问,而非答案,仅有的几个人提供了所谓“答案”(那是一个网页地址),根本打不开。[/SIZE][/FONT]
) P) J3 {; G) K/ |; K5 Z( Z    我完全是按照README中所述来安装的,可是make了7个中居然有5个报错![/SIZE][/FONT]) d- r) ]* [4 n, y3 K
    下面是我安装的步骤:[/SIZE][/FONT]
" A$ G) f: d+ G0 H2 [[/SIZE][/FONT] . {: T, O) _; m, j( Q/ v* T
cd unpv12e/
/ t. A3 V# f1 G4 D6 V- w( X ./configure
) d% y; m) k( r' ^& z- e   成功[/SIZE][/FONT]- l9 j2 W" v/ s
[/SIZE][/FONT]
0 e: H$ {. Y# s. v0 X' v cd lib
! K8 K6 H: N& A3 @& ]' U' q make[/SIZE][/FONT]) A; e% S- ^/ \% `8 F; @
[/SIZE][/FONT] + E' L1 f) e/ O6 \5 j
报错:[/COLOR][/SIZE][/FONT]
, y; e8 m( Z& h" B
复制内容到剪贴板
代码:
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]0 F' U6 m7 y1 F- w* v% |
[/SIZE][/FONT] 9 C3 k! L+ H- ~9 l% t3 c
cd ../libfree
; T2 g0 ?+ X* @/ R+ ]( {* U6 o5 ^1 b1 H make[/SIZE][/FONT]
  ]: H7 Q" D: d  |' d; i   成功[/SIZE][/FONT]; s1 s; O* `/ x7 j
[/SIZE][/FONT]
" F% A( \9 A1 Q" Q2 y4 cd ../libgai+ s) y2 f' y  t$ T1 `) E
make[/SIZE][/FONT]/ N0 ]) r' b2 I  P, M4 r
报错:[/COLOR][/SIZE][/FONT]
/ i/ c4 M" Y6 j# o' `+ l' t, ]5 j
复制内容到剪贴板
代码:
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]
8 C3 u( S# @9 v) m( W[/SIZE][/FONT] 7 ^! P$ q% y7 Y/ `& z4 s
cd ../libroute/ Q$ t7 q/ ~3 Y. `
make[/SIZE][/FONT]. b4 j/ f! F. s2 ]8 o' G
报错:[/COLOR][/SIZE][/FONT]4 w  }" k3 r4 E- `, w
复制内容到剪贴板
代码:
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]- }; N, i3 J0 I% o; K
[/SIZE][/FONT]
1 a+ V6 C7 ~6 O$ g% o2 x cd ../libxti
% n0 W3 x) L, s" n- J- k make[/SIZE][/FONT]
8 C* o% K; I4 V3 H报错:[/COLOR][/SIZE][/FONT]
# s* L- }" I3 K4 p7 t- x
复制内容到剪贴板
代码:
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]$ v9 Q' `6 g( ~5 d
[/SIZE][/FONT]
/ Z1 {% S. g* e; }3 ` cd ../intro/ ^7 |0 \4 d6 J1 v3 ^
make[/SIZE][/FONT]; p7 L5 z: `1 a- D3 ^1 Y
报错:[/COLOR][/SIZE][/FONT]
8 x# @- B9 z! P/ U5 K7 l- k
复制内容到剪贴板
代码:
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], q4 G  n6 T2 j6 L; ]# \% v
小弟最终的感想:这98块钱花得太值了!!
' K- K# q0 n+ a/ E& Y[/SIZE][/FONT]      

TOP

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

TOP

必须是BSD才能用这个程序吗?: p6 B8 t' o! b5 @& z. D% u- X
我刚刚用GOOGLE翻译了一下这个网页:7 ?5 `" _3 |: P& h7 j
[URL]http://www.kegel.com/unpv1/[/URL]9 V: {2 t* i2 f9 H+ ~

. A* F# t" X6 d# m, p0 @& V- s/ U感觉好像是某个让它可以安装于linux的补丁(只是好像,因为英文不好,所以没办法确定)
: N, u7 [  v5 t) V
1 ]/ Z' l# L) c; L  D   但google的翻译质量实在让人喷饭,里面满篇的烟焦油、油渍、出口硝石、码头港口、还有粑粑什么的……汗,驴唇不对马嘴……这不过是一个关于《UNIX网络编程》的网页……      

TOP

[QUOTE=Zark;568565]我完全是按照README中所述来安装的,可是make了7个中居然有5个报错!8 |# A" ^2 U: K5 T0 M0 N* X
... ...4 k( F8 L; }* Q. [$ N0 y4 O
小弟最终的感想:这98块钱花得太值了!![/QUOTE]
$ B( \6 W! n: Q3 aunpv12e 是 98 年出版的, 当时的系统跟现在可能有些差异, 因此不能顺利的 make, 可以理解, 自己稍作修改就能 pass. unpv13e 是 03 年出版的, 情况可能好些, 因此最好还是直接看第三版, 不晓得楼主为什么还买第二版       
'
◆ 发帖时请【突出主题】, 以便您的问题能够及时得到回复
◆ 发帖时请将您的【代码】或者【脚本】写在 [code] 和 [/code] 中间

TOP

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

TOP

发新话题