ChinaUnix.net
相关文章推荐:

apue2e 使用

目前在看 apue 2e,在试书中的例子时,总是编译不过。不知道为什么,帮忙看一下。谢谢! gcc SigUsr.c 返回出错信息 /tmp/cczcMa7A.o(.text+0x31): In function `main': : undefined reference to `err_sys' /tmp/cczcMa7A.o(.text+0x56): In function `main': : undefined reference to `err_sys' /tmp/cczcMa7A.o(.text+0x9d): In function `sig_usr': : undefined reference to `err_dump' collect2: ld returned 1 exit statu...

by trailblazer - C/C++ - 2006-07-27 13:46:02 阅读(3077) 回复(4)

相关讨论

我刚刚开始看Unix 环境高级编程, 里面很多例子要用到作者他自己写的apue.h, 然后我就去网站下了这本书的相关的源代码包. 最初我是直接把apue.h放在/usr/include下, 写程序时也include 了,可是编译程序时报错说 undefined reference to `err_sys' 之类的信息, 'err_sys' 是 apue.h里的 大家读这本书的时候有没有也搞过它的源代码, 请帮帮我, 谢谢大家

by jacksun1105 - C/C++ - 2010-01-18 15:46:06 阅读(7951) 回复(16)

我正在学习apue,很多东西看了之后就忘,我想知道有没有一些有趣的练习方面的书籍,这样可以练习学过的知识,还能找到乐趣,比如说一些小的游戏之类的...谢过了~

by boerhawking - C/C++ - 2008-12-10 08:15:27 阅读(4127) 回复(21)

[code]#define HASH(fp) (((unsigned long )fp)%29) struct foo *fh[29]; struct foo{ int f_count; struct foo *f_next; }; foo_alloc{ struct foo *fp; int idx; if((fp=malloc(siezof(struct foo)))!=NULL){ ....... idx=HASH(fp);/*这个idx的值能是什么呢?*/ fp->f_next=fh[idx]; /*这里什么意思?是将那...

by dianlongliu - C/C++ - 2008-07-17 12:55:22 阅读(1286) 回复(3)

重读很有收获。

by haoji - IT图书与评论 - 2008-05-16 22:19:52 阅读(2543) 回复(1)

系统是solaris9,按上讲的下了例子的原程序,按它的README中 所讲先要编译一个libmisc.a,可是错误报了一堆,它用到的/usr/include里文件好象和我 的不太一样,可能是书中例子很老了,各位高手,告诉我一个解决的办法吧?谢谢了。。。

by pump_006 - Solaris - 2005-12-31 22:45:07 阅读(1152) 回复(2)

我在mac 10.5下编译apue2.e。已根据http://www.apuebook.com/上FAQs 将CMSG_LEN的定义在apue.h加了进去。可还是出现以下错误。 loop.c:11: error: syntax error before ‘allset’ loop.c:11: warning: type defaults to ‘int’ in declaration of ‘allset’ loop.c:11: warning: data definition has no type or storage class loop.c: In function ‘loop’: loop.c:20: error: ‘fd_set’ undeclared (first use in this func...

by poornewer - C/C++ - 2009-02-05 21:34:17 阅读(1905) 回复(6)

最近在看apue, 看到信号这一章的时候有这样的一个例子!(部分) int sig_int(), sig_quit(); if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, sig_int); if (signal(SIGQUIT, SIG_IGN) != SIG_IGN) signal(SIGQUIT, sig_quit) 看到第一行,int sig_int(), sig_quit(); 给我的感觉像是定义了两个int变量! 但看下面的两句却是把它们当成函数! 但是如果函数,从来没有见过这种定义方式! 了解的朋友说说原因! ...

by liu1061 - C/C++ - 2008-10-01 12:05:26 阅读(2768) 回复(12)

apue中的出错处理中用到了MAXlINE 我的linux显示未定义 我现在的做法是用define 我想知道Linux下如何找这个MAXLINE [ 本帖最后由 zszjxh 于 2008-6-27 13:00 编辑 ]

by zszjxh - C/C++ - 2008-06-27 12:54:54 阅读(2612) 回复(2)

再结构struct acct 之前定义了 [code] typedef u_short comp_t; /*3_bit base 8 exponent;13_bit fracion*/ [/code] 然后是一个函数 [code] static unsigned long compt2ulong(comp_t comptime) /* convert comp_t to unsigned long */ { unsigned long val; int exp; val = comptime &0x1fff; /* 13-bit fraction */ exp = (comptime >> 13) & 7; /* 3-bit exponent (0-7) */ while (exp-- > 0) val *= 8...

by dianlongliu - C/C++ - 2011-01-18 14:47:59 阅读(2228) 回复(5)