apue-ubuntu环境搭建

你离开我真会死。 提交于 2019-12-05 00:35:55

title: apue环境搭建
date: 2019/11/19 19:25:18
toc: true
---

apue环境搭建

  1. 下载编译

    wget http://www.apuebook.com/src.3e.tar.gz
    tar -zxvf src.3e.tar.gz
    cd apue.3e/
    sudo apt-get install libbsd-dev
    make 
  2. 问题解决

     1. undefined reference to `major'
     man 一下添加头文件 #include <sys/sysmacros.h>
     2. “struct 'FILE' has no member named'__pad'” error when using 
     这个查了一下是代码不兼容,先注释掉这个文件夹
         > https://stackoverflow.com/questions/55770771/how-to-fix-struct-file-has-no-member-named-pad-error-when-using-make-in
     DIRS = lib intro sockets advio daemons datafiles db environ \
               fileio filedir ipc1 ipc2 proc pty relation signals standards \
                termios threadctl threads printer exercises
        # stdio
    
  3. 文件复制,libapue.aapue.h头文件中包含的所有函数及宏定义的具体实现,是一个静态链接库。

    具体的实现就在这个源码/lib

    sudo cp ./include/apue.h /usr/include/
    sudo cp ./lib/libapue.a /usr/local/lib/
    
    # 以后链接这个库 -lapue 
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!