Redian新闻
>
unix network programming (Stevens) book V1 (2ed, 3ed) code cannot run on Linux
avatar
unix network programming (Stevens) book V1 (2ed, 3ed) code cannot run on Linux# Unix - 噫吁兮,危乎高哉
l*9
1
I am trying to download and run the c code on Linux for
UNIX Network Programming, Volume 1, Second Edition: Networking APIs: Sockets
and XTI, Prentice Hall, 1998, ISBN 0-13-490012-X. It is by W. Stevens
Richard
http://kohala.com/start/unpv12e/unpv12e.tar.gz
But, when I build the code, I got error:
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
I commented out struct in_pktinfo. Then I got new errors:
gcc -g -O2 -D_REENTRANT -Wall -c -o in_cksum.o in_cksum.c
gcc -g -O2 -D_REENTRANT -Wall -c -o inet_ntop.o inet_ntop.c
inet_ntop.c: In function âinet_ntopâ:
inet_ntop.c:61: error: argument âsizeâ doesnât match
prototype
/usr/include/arpa/inet.h:67: error: prototype declaration
make: *** [inet_ntop.o] Error 1
I do not want to debug for the whole 575 files one by one.
Where can I get new code without these errors ? the new version book has bug
-free code ?
The old code is only for old UNIX.
Thanks
avatar
l*9
2
I am trying to download and run the c code on Linux for
UNIX Network Programming, Volume 1, Second Edition: Networking APIs: Sockets
and XTI, Prentice Hall, 1998, ISBN 0-13-490012-X. It is by W. Stevens
Richard
http://kohala.com/start/unpv12e/unpv12e.tar.gz
But, when I build the code, I got error:
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
I commented out struct in_pktinfo. Then I got new errors:
gcc -g -O2 -D_REENTRANT -Wall -c -o in_cksum.o in_cksum.c
gcc -g -O2 -D_REENTRANT -Wall -c -o inet_ntop.o inet_ntop.c
inet_ntop.c: In function âinet_ntopâ:
inet_ntop.c:61: error: argument âsizeâ doesnât match
prototype
/usr/include/arpa/inet.h:67: error: prototype declaration
make: *** [inet_ntop.o] Error 1
I do not want to debug for the whole 575 files one by one.
Where can I get new code without these errors ? the new version book has bug
-free code ?
The old code is only for old UNIX.
Thanks
avatar
M*n
3
I remember the codes were written for BSD.
You need to tweak the source codes a little bit.

Sockets

【在 l******9 的大作中提到】
: I am trying to download and run the c code on Linux for
: UNIX Network Programming, Volume 1, Second Edition: Networking APIs: Sockets
: and XTI, Prentice Hall, 1998, ISBN 0-13-490012-X. It is by W. Stevens
: Richard
: http://kohala.com/start/unpv12e/unpv12e.tar.gz
: But, when I build the code, I got error:
: 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

avatar
M*n
4
I remember the codes were written for BSD.
You need to tweak the source codes a little bit.

Sockets

【在 l******9 的大作中提到】
: I am trying to download and run the c code on Linux for
: UNIX Network Programming, Volume 1, Second Edition: Networking APIs: Sockets
: and XTI, Prentice Hall, 1998, ISBN 0-13-490012-X. It is by W. Stevens
: Richard
: http://kohala.com/start/unpv12e/unpv12e.tar.gz
: But, when I build the code, I got error:
: 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

avatar
d*n
5
go this page to download unp13e
http://www.unpbook.com/src.html
or wget
http://www.unpbook.com/unpv13e.tar.gz
your downloaded version is already deprecated.

Sockets

【在 l******9 的大作中提到】
: I am trying to download and run the c code on Linux for
: UNIX Network Programming, Volume 1, Second Edition: Networking APIs: Sockets
: and XTI, Prentice Hall, 1998, ISBN 0-13-490012-X. It is by W. Stevens
: Richard
: http://kohala.com/start/unpv12e/unpv12e.tar.gz
: But, when I build the code, I got error:
: 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

avatar
T*l
6

Sockets

【在 l******9 的大作中提到】
: I am trying to download and run the c code on Linux for
: UNIX Network Programming, Volume 1, Second Edition: Networking APIs: Sockets
: and XTI, Prentice Hall, 1998, ISBN 0-13-490012-X. It is by W. Stevens
: Richard
: http://kohala.com/start/unpv12e/unpv12e.tar.gz
: But, when I build the code, I got error:
: 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

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。