Unix Programming - compile apue
来源:互联网 发布:商务通怎么导出数据 编辑:程序博客网 时间:2024/06/06 09:18
<<Advanced Programming in the Unix Environment>>
$ wget http://www.apuebook.com/src.3e.tar.gz$ make
apue$ cat myls.c#include "apue.h"#include <dirent.h>intmain(int argc, const 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);}
apue$ gcc myls.cUndefined symbols for architecture x86_64: "_err_quit", referenced from: _main in myls-dfacfa.o "_err_sys", referenced from: _main in myls-dfacfa.old: symbol(s) not found for architecture x86_64clang: error: linker command failed with exit code 1 (use -v to see invocation)
I wanted to know how I can fix this problem. I also want to be able to run a code I write in any directory, can anyone guide me on that too?
apue$ gcc -o myls myls.c -I /Users/helloworld/Desktop/apue.3e/include/ -L /Users/helloworld/Desktop/apue.3e/lib/ -lapue
References
http://unix.stackexchange.com/questions/105483/compiling-code-from-apue
https://segmentfault.com/a/1190000004359057
0 0
- Unix Programming - compile apue
- unix compile
- Unix Network Programming Volume 1 Compile issue solution for the 2nd and 3rd edition
- Unix programming
- UNIX配置apue.h
- [APUE]UNIX 标准化
- APUE第一章 UNIX基础知识
- apue:UNIX基础知识
- APUE第一章 Unix基础知识
- Advanced Programming int the Unix Environtment(3rd)下无法找到apue.h文件的解决方法
- 关于APUE(Advanced Programming in the Unix Environment)第三版 代码在ubuntu中的编译运行
- UNIX进程概念小结(apue)
- 【APUE】1、第一章UNIX基础知识
- [APUE]再读之 unix 基础知识
- 《apue》读书笔记 第一章 UNIX基础知识
- APUE学习: 第一章, Unix基础知识
- apue:UNIX进程的环境
- [APUE]第一章UNIX基础知识总结
- 区块链如何才能避免未来主义的危险
- 解析memcached
- 【多线程编程】基础篇二
- SpringBoot 模板引擎 Template engines
- 黑马视频
- Unix Programming - compile apue
- OpenWRT开发--Build SDK
- Java class 文件结构及解析
- 最短路径——迪杰斯特拉算法 学习笔记
- C++和java多态的区别
- 每日一Vim(10)-----正则表达式
- Android--百度地图密钥申请+环境配置(一)
- iOS设置某个界面允许横竖屏切换
- 百度:坚决落实国家网信办联合调查组整改要求