Chinaunix首页 | 论坛 | 博客
  • 博客访问: 859557
  • 博文数量: 82
  • 博客积分: 2283
  • 博客等级: 大尉
  • 技术积分: 2007
  • 用 户 组: 普通用户
  • 注册时间: 2012-07-15 22:19
文章分类

全部博文(82)

文章存档

2012年(82)

分类: LINUX

2012-08-21 11:03:26

 1. 编译原书所带例子:
  unpv22e.tar.gz 下载地址:
  2. 解压:
  $tar -zxvf unpv22e.tar.gz
  3. 编译:
  $cd unpv22e
  $ ./configure
  $ cd lib
  $ make
  gcc -g -O2 -D_REENTRANT -Wall -D_POSIX_PTHREAD_SEMANTICS -c -o daemon_inetd.o daemon_inetd.c
  In file included from /usr/include/netinet/in.h:23,
  from /usr/include/rpc/types.h:90,
  from /usr/include/rpc/rpc.h:41,
  from unpipc.h:115,
  from daemon_inetd.c:1:
  /usr/include/stdint.h:49: 错误:重复的 'unsigned'
  /usr/include/stdint.h:49: 错误:声明指定了两个以上的数据类型
  /usr/include/stdint.h:50: 错误:重复的 'unsigned'
  /usr/include/stdint.h:50: 错误:重复的 'short'
  /usr/include/stdint.h:52: 错误:重复的 'unsigned'
  /usr/include/stdint.h:52: 错误:声明指定了两个以上的数据类型
  make: *** [daemon_inetd.o] 错误 1
  这时需要修改unpipc.h第115行。unpipc.h中把115内容注释掉。再次编译。
  $ make
  gcc -g -O2 -D_REENTRANT -Wall -D_POSIX_PTHREAD_SEMANTICS -c -o daemon_inetd.o daemon_inetd.c
  In file included from daemon_inetd.c:1:
  unpipc.h:479: 错误:expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
  unpipc.h:480: 错误:expected ')' before '*' token
  make: *** [daemon_inetd.o] 错误 1
  再次出现错误,把unpipc.h中第479,480行注释掉。再次编译。
  $ make
  ...
  gcc -g -O2 -D_REENTRANT -Wall -D_POSIX_PTHREAD_SEMANTICS -c -o wrapsunrpc.o wrapsunrpc.c
  wrapsunrpc.c:3: 错误:expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
  wrapsunrpc.c:16: 错误:expected ')' before '*' token
  make: *** [wrapsunrpc.o] 错误 1
  这时还会出现上面的错误,这时需要修改unpv22e/Make.defines中的LIB_OBJS的".o"文件,删除"wrapsunrpc.o"。
  再次编译。
  $ make
  --这次应该没有问题了。
阅读(3733) | 评论(3) | 转发(1) |
给主人留下些什么吧!~~

流云哭翠2012-08-21 14:13:45

Bean_lee: stevens 老爷子死的有点早,很多人预计他是有UNP volume3 的。.....
这样啊...很遗憾这套书我看起来还挺吃力的  也不知道3写的是什么~~

Bean_lee2012-08-21 13:04:41

据说是滑雪除了意外。唉,痛失大师。

Bean_lee2012-08-21 13:03:35

stevens 老爷子死的有点早,很多人预计他是有UNP volume3 的。