配置好动态链接库或者静态链接库

1,下载UNIX网络编程书的头文件及示例源码unpv13e

2    按照readme来编译

Execute the following from the src/ directory:

./configure    # try to figure out all implementation differences

cd lib         # build the basic library that all programs need

make           # use "gmake" everywhere on BSD/OS systems

cd ../libfree  # continue building the basic library

make

3. 这个时候可以按照readme里提到的方法编译运行该源文件里的代码

cd ../intro    # build and test a basic client program

make daytimetcpcli

./daytimetcpcli 127.0.0.1

但是如果想在任何位置都可以编译unix网络编程的程序, 或者说使用unp.h头文件

4,将生成的libunp.a静态库复制到/usr/lib/和/usr/lib64/中。

  1. cd ..   //回到unpv12e目录
  1. sudo cp libunp.a /usr/lib
  2. sudo cp libunp.a /usr/lib64

5,修改unp.h并将其和config.h拷贝到/usr/include中,为了以后include方便

  1. gedit lib/unp.h   //将unp.h中#include "../config.h"修改为#include "config.h"
  1. sudo cp lib/unp.h /usr/include
  2. sudo cp config.h /usr/include

最新文章

  1. Debian中如何切换默认Python版本
  2. onTouch与onClick事件的关系
  3. iOS 应用数据存储的常用方式
  4. PHP 6:PHP 基本数据类型
  5. MySQL查询性能优化一则
  6. ajax基本用法介绍
  7. 分布式服务治理框架dubbo
  8. Python——线程1
  9. 计算几何总结(Part 1~2)
  10. Missing artifact com.github.pagehelper:pagehelper:jar:3.4.2-fix的解决方法(最简单的方法)
  11. --save与--save-dev的区别
  12. 洛谷 P1223排队接水【贪心】
  13. KiCad 如何画板框
  14. C++根据传入的函数指针来解析需要的参数
  15. MFC Edit控件的使用~~
  16. spark streaming从指定offset处消费Kafka数据
  17. 因环境变量设置问题引起的command not found
  18. 高性能流媒体服务器EasyDarwin
  19. 网络请求+Gson解析--Retrofit 2
  20. Java开源-astar:A 星算法

热门文章

  1. HTML中的图片标签的用法!
  2. English-培训5-How much is it
  3. JavaScript CryptoJS库 加密与解密
  4. kubernetes 资源清单定义入门
  5. Nginx安装与配置文件nginx.conf详解
  6. 直接插入排序算法(java)
  7. Python面向对象Day1
  8. 如何11 周打造全能Python工程师!
  9. C++——友元 friend
  10. 手写代码之写斐波那契数列-传入key值求对应的value