apue.h头文件错误和error错误处理
来源:互联网 发布:ubuntu 下载器推荐 编辑:程序博客网 时间:2024/06/06 01:42
《unix环境高级编程 》第三版学习
apue.h头文件错误参考网址
http://www.linuxidc.com/Linux/2013-01/77467.htm
注意点:
- 按要求解压到/root目录
tar -xzvf src.tar.gz -C /root - 上面网址的第4点(将/root/apue.2e/ipp/printd.h中第977行中的status替换为Status。)
没有printd.h文件 是printd.c文件
按要求即可编程测试
例如下面的打印进程ID,pid.c
#include <apue.h>int main(void){ printf("process id : %ld\n", (long)getpid()); exit(0);}
gcc -o pid pid.c 编译链接,运行即可
在编译其他文件如ls1.c时出现了
ding@ding-Lenovo-G480:~/桌面/apue.2e/file$ gcc -o ls1 ls1.c
/tmp/cciUZ4Ir.o:在函数‘main’中:
ls1.c:(.text+0x20):对‘err_quit’未定义的引用
ls1.c:(.text+0x5b):对‘err_sys’未定义的引用
参考网址
http://blog.sina.com.cn/s/blog_6e27e6f10100w234.html
不同的是 要将apue.2e/lib/error.c 复制到/usr/local/include,再按要求修改
ls1.c文件内容如下:
#include "apue.h"#include <dirent.h>intmain(int argc, char *argv[]){ DIR *dp; struct dirent *dirp; if (argc != 2) err_quit("usage: ls directory_name"); if ((dp = opendir(argv[1])) == NULL) err_sys("can't open %s", argv[1]); while ((dirp = readdir(dp)) != NULL) printf("%s\n", dirp->d_name); closedir(dp); exit(0);}
0 0
- apue.h头文件错误和error错误处理
- apue.h头文件
- apue.h头文件
- apue.h头文件
- 找不到opencv头文件"cv.h"错误处理
- APUE 头文件apue.h 解决方法
- APUE(1) ---- apue.h头文件记录
- apue.h头文件内容
- 添加头文件apue.h
- CentOS解决apue.h错误
- 头文件atlstr.h使用错误问题
- 使用头文件winbase.h的错误
- .h头文件出现重定义错误
- 使用头文件winbase.h的错误
- fatal error: Python.h错误处理
- error4430, errro2419 error C2182等win: 错误,加window.h 头文件即可
- apue读书笔记【三】:处理可变参数(3) snprintf 、apue.h和error.c的封装
- apue.h头文件的配置
- 关于开发产品的散谈
- 如何设置Android中TextView的行间距
- 在eclipse中如何更好的实现代码的code review
- 怎么用ChemBio 3D检查结构信息
- QByteArray QString Base64 UTF8
- apue.h头文件错误和error错误处理
- C++ 获得当前执行文件的路径
- 不要寒了父母心
- 数字与字符串之间的转换
- Objective-C开发之----atomic与nonatomic,assign,copy与retain的定义和区别
- Intent打开各种资源
- 可侧滑的 listview
- ios 关于常用的一些第三方框架的介绍
- 如果没有找到布局