l******9 发帖数: 579 | 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 OS.
Thanks |
|