tar zxvf unpv13e.tar.gz
./configure
cd lib
make
cd ../libfree
make
cd ../libgai
make
cd .. // 回到主目錄
// 修改unp.h
gedit lib/unp.h // 修改 #include "../config.h" 為 #include "config.h"
// 拷貝頭文件
sudo cp config.h /usr/local/include
sudo cp lib/unp.h /usr/local/include
// 拷貝庫文件
sudo cp libunp.a /usr/local/lib
// 下來我們就可以編譯書中的一些例子了,可以使用庫文件鏈接 -lunp
我是ubuntu 64
cd ../libfree make inet_ntop.c:61: error: argument 'size' doesn't match prototype /usr/include/arpa/inet.h:153: error: prototype declaration inet_ntop.c第61行 size_t size ->改成 socklen_t size 下載鏈接:
http://www.ituring.com.cn/book/164
來源:
http://www.cppfans.org/1411.html
出錯請看這里:
http://bamboobee.iteye.com/blog/1706553