Unix高级环境编程 学习
2013-07-18 10:27
337 查看
编写第一个例子会出现
other_name.c: In function ‘opendir_file’:
other_name.c:21:2: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
/tmp/cc2qJGMx.o: In function `opendir_file':
other_name.c:(.text+0x14): undefined reference to `err_quit'
other_name.c:(.text+0x3b): undefined reference to `err_sys'
collect2: ld returned 1 exit status
这是因为需要下载随书附带的源代码并编译所需的库文件,步骤在这里可以参照博客 http://blog.csdn.net/davidyuxuan/article/details/8820927
在这里编译make源码的时候会可能出现错误:
/usr/include/i386-linux-gnu/bits/timex.h:31:7: 错误: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘.’ token
make[2]: *** [printd.o] 错误 1
make[2]:正在离开目录 `/tmp/apue.2e/ipp'
make[1]: *** [linux] 错误 1
make[1]:正在离开目录 `/tmp/apue.2e'
make: *** [all] 错误 2
这里可以参照 http://blog.163.com/fishing_1/blog/static/41594482013335953444/ 就可以顺利解决
other_name.c: In function ‘opendir_file’:
other_name.c:21:2: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
/tmp/cc2qJGMx.o: In function `opendir_file':
other_name.c:(.text+0x14): undefined reference to `err_quit'
other_name.c:(.text+0x3b): undefined reference to `err_sys'
collect2: ld returned 1 exit status
这是因为需要下载随书附带的源代码并编译所需的库文件,步骤在这里可以参照博客 http://blog.csdn.net/davidyuxuan/article/details/8820927
在这里编译make源码的时候会可能出现错误:
/usr/include/i386-linux-gnu/bits/timex.h:31:7: 错误: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘.’ token
make[2]: *** [printd.o] 错误 1
make[2]:正在离开目录 `/tmp/apue.2e/ipp'
make[1]: *** [linux] 错误 1
make[1]:正在离开目录 `/tmp/apue.2e'
make: *** [all] 错误 2
这里可以参照 http://blog.163.com/fishing_1/blog/static/41594482013335953444/ 就可以顺利解决
相关文章推荐
- UNIX环境高级编程学习之第十章信号-信号集的操作,让进程阻塞SIGQUIT信号
- UNIX环境高级编程学习之第十一章线程-使用读写锁
- UNIX环境高级编程学习之第十三章守护进程 - 初始化一个守护进程
- Unix环境高级编程 第二章 学习笔记
- UNIX环境高级编程学习之第十五章进程间通信 - 通过匿名管道实现父子进程同步
- UNIX环境高级编程学习环境搭建---apue.h(第三版)
- <<UNIX环境高级编程>>学习总结——第二章:UNIX标准化及实现
- UNIX环境高级编程学习之第十章信号-信号的基本操作(绑定/忽略/默认/发送)
- UNIX环境高级编程学习之第十一章线程-线程的创建、退出、等待、取消、分离
- <<UNIX环境高级编程>>学习笔记之环境搭建
- UNIX环境高级编程学习之第七章进程环境-存储器分配malloc
- UNIX环境高级编程学习之第十五章进程间通信 - 通过有名管道(命名管道)实现进程间通信
- UNIX环境高级编程学习之第十六章网络IPC:套接字 - 非阻塞的Socket通信EPoll模型(多路复用), 实用Socket通信模板
- UNIX环境高级编程学习之第七章进程环境-环境变量表读取/添加/修改/删除
- UNIX环境高级编程——学习路线图
- UNIX环境高级编程学习环境搭建---apue.h
- UNIX环境高级编程学习笔记
- UNIX环境高级编程学习之第六章系统数据文件和信息-取所有用户名和UID, GID
- UNIX环境高级编程学习之第十二章线程控制-可重入(线程安全)的getenv方法
- unix环境高级编程学习——碎碎念