Transferred from: http://blog.csdn.net/fuxingdaima/article/details/8820009
SOURCE Download unpv13e.tar.gz
If you are downloading version unpv12e.tar.gz, you will encounter a lot of trouble at compile time.
$ tar xzvf unpv13e.tar.gz
$ CD unpv13e
The compilation process, and the problems encountered. You can view the compilation steps by viewing the Readme file
(1) Compile the library
$./configure
$ cd Lib
$ make
$ CD. /libfree
$ make
Error: inet_ntop.c:61:error:argument ' size ' doesn ' t match prototype
Workaround: Enter the document and change 61 lines to socklen_t size;
(2) Compiling client programs and server-side programs
$ CD. /intro
$ make
(3) Run the test
$ ./daytimetcpsvr&//background running server
$./DAYTIMETCPCLI//Run the client, the following date output indicates that the compilation and Test succeeded
(4) with the environment in order to test the self-written program
$ CD. Back to the unpv13e directory
$ CP Libunp.a/usr/lib
$ CP libunp.a/usr/lib64
$ CP lib/unp.h.
$ VI unp.h//Put just a copy of the Unp.h file in the # include ". /config.h "changed to #include" Config.h "
$ CP unp.h Config.h/usr/include
Since then, you can directly include<unp.h> in the code you have written, and with the option-LUNP at compile time you can link libunp.a.
The No. 0 Chapter: Preparation Environment