UNIX 环境 2ed 中高级编程的工作代码,最好在 Ubuntu/gcc4 上
我正在学习 Linux 系统编程,我正在阅读 APUE 2ed 书 W.理查德·史蒂文斯和斯蒂芬·A.拉戈。
http://www.apuebook.com/ 上给出的代码不起作用。未定义的定义,未实现的函数(在附录中给出)
任何人都可以指出我为 APUE 2ed 编译的代码,最好是在 Ubuntu/gcc4 上。
i was learning Linux system programming and i am going through the APUE 2ed book by
W. Richard Stevens and Stephen A. Rago.
The code given on http://www.apuebook.com/ does not work. Undefined definitions, un-implemented functions (given in appendix)
Can anyone point me to getting-compiled code for APUE 2ed, preferably on Ubuntu/gcc4.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
rotkas 有一个 github 存储库,其中包含经过修改的代码,使其可以在现代系统上编译。它在 OSX 10.7 和 Ubuntu 10.04 上对我有用。不过最近不需要了。
https://github.com/roktas/apue2e
rotkas has a github repo that contains the code with modifications to make it compile on modern systems. It worked for me on OSX 10.7 and Ubuntu 10.04. Haven't needed it recently, though.
https://github.com/roktas/apue2e
我下载了源代码,然后根据 README 文件,编辑 Make.defines.linux 并将 WKDIR 更改为指向我解压源代码的位置。然后我运行了 make 并编译了几乎所有内容,只有一些警告。
不过,threadctl 没有编译,我必须在 getenv1.c 中将
#include
更改为#include
和 getenv3.c 在编译之前(不确定这是否是最好的修复,但它有效。)I downloaded the source and then, as per the README file, edited Make.defines.linux and changed WKDIR to point to where I had unpacked the source code. Then I ran make and just about everything compiled with only a few warnings.
threadctl didn't compile, though, and I had to change
#include <limits.h>
to#include <linux/limits.h>
in getenv1.c and getenv3.c before it would compile (not sure if this is the best fix, but it works.)谢谢 Jacinda 提供的链接,它对我有用,但我也必须做其他事情,
我使用了 github/roktas 的源代码,并使用以下命令来运行程序,
如果有人有同样的问题可以转到 此链接。
Thank you Jacinda for the link it worked for me, but I had to do something else too
I used the source code from github/roktas and used the following command in order to run the programs
if anyone has the same problem can go to this link.