apue初识

一、源码编译经验

  1、源码下载地址:http://www.apuebook.com/

  2、编译步骤:

    1)进入apue源码目录,make时,出现错误提示:“E: Unable to locate package libbsd”

    2)所以需要安装libbsd-dev, 但用apt-get install安装时,提示依赖失败信息,所以改为编译安装

    3)下载libbsd源码, 网址:https://libbsd.freedesktop.org/wiki/

      git命令:git clone https://anongit.freedesktop.org/git/libbsd.git

    4)进入源码包libbsd,安装步骤如下:

      a)./autogen, 会生成configure文件

      b)./configure, 会生成Makefile文件

      c)make

      d)sudo make install, 会把编译好的库文件安装在/usr/local/lib目录下

    5)再重新进入apue源码目录,make通过

二、源码学习

  1、fig1.3

    1) Linux下DIR,dirent,stat等结构体详解

    2) what is __dirstream, where can we find the definition

    3) Linux ar命令

    4) Makefile中的$@, $^, $< , $?, $%, $+, $*

  4、fig4_10

    1)stat中的st_dev和st_rdev

  5、fig5_15

    1)内存流和null字节

  8、第八章

   1)APUE杂记:解释器文件

  10、第十章

    1)signal的常量定义头文件: /usr/include/bits/signum.h

      

原文地址:https://www.cnblogs.com/shanyu20/p/12510308.html