16.unix网络编程一卷 unp.h
unix網(wǎng)絡(luò)編程?--ubuntu下建立編譯環(huán)境
1.安裝編譯器,安裝build-essential
sudo apt-get install build-essential
2.下載本書的頭文件
下載unp13e:?http://pix.cs.olemiss.edu/csci561/prg561.1.html
3.進(jìn)入unp13e 查看readme,照下列提示操作
?1)chmod u+x configure
??????./configure
?2)cd lib
????????make
?3)cd?../libfree (這步出錯(cuò)沒關(guān)系)
??????make
?4)cd?../libgai(這步出錯(cuò)沒關(guān)系)
??????make
4.將生成的libunp.a靜態(tài)庫復(fù)制到/usr/lib?and?/usr/lib64中
?cd..?//回到unpv13e目錄
?sudo cp libunp.a /usr/lib
?sudo cp libunp.a /usr/lib64
5.修改unp.h并將其和config.h拷貝到/usr/include?中,為了以后include方便
?vim lib/unp.h //將unp.h 中#include?“../config.h”修改為#include?“config”
?sudo cp lib/unp.h /usr/include
?sudo cp config.h /usr/inlcude?
6.編譯源代碼
?cd?./intro
?gcc daytimetcpcli.c?-o daytimetcpcli?-lunp
?
轉(zhuǎn)載于:https://www.cnblogs.com/xiaochi/p/9018520.html
總結(jié)
以上是生活随笔為你收集整理的16.unix网络编程一卷 unp.h的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Linux(centos)新建,删除,移
- 下一篇: 洛谷 P4011 孤岛营救问题【最短路+