LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 660|回复: 5

编译到了第五章utils-2.12的时候出现了以下的错误,以前没有遇到过。

[复制链接]
发表于 2003-10-12 23:31:05 | 显示全部楼层 |阅读模式
[lfs@Lhcyf_LFS util-linux-2.12]$ make -C mount mount umount
make: Entering directory `/source/lfssoft/util-linux-2.12/mount'
cc -c -pipe -O2 -mcpu=i486 -fomit-frame-pointer -I../lib -Wall -Wmissing-prototypes -Wstrict-prototypes -DNCH=1   -D_FI                      LE_OFFSET_BITS=64 -DSBINDIR=\"/sbin\" -DUSRSBINDIR=\"/usr/sbin\" -DLOGDIR=\"/var/log\" -DVARPATH=\"/var\" -DLOCALEDIR=\                      "/usr/share/locale\" -O2 -DHAVE_NFS mount.c
In file included from mount.c:65:
loop.h:20: error: parse error before "__kernel_dev_t"
loop.h:20: warning: no semicolon at end of struct or union
loop.h:22: error: parse error before "lo_rdevice"
loop.h:22: warning: type defaults to `int' in declaration of `lo_rdevice'
loop.h:22: warning: data definition has no type or storage class
loop.h:31: error: parse error before '}' token
make: *** [mount.o] 错误 1
make: Leaving directory `/source/lfssoft/util-linux-2.12/mount'
[lfs@Lhcyf_LFS util-linux-2.12]$

大家帮我看看是什么原因,这是第五章的后半部分的utils-2.12部分。
我用的是LFS-5.0-pre2
 楼主| 发表于 2003-10-13 00:01:49 | 显示全部楼层
已经解决了,其实就是一个头文件的变量没有定义的问题。
在/tools/include/asm/posix_types.h这个文件里面定义了许多的__kernel_**_*此类的变量,但是没有_kernel_dev_t,而查看了
my_dev_t.h提到该变量应该是unsigned short
这样在/tools/include/asm/posix_types.h里面增加一行:
typedef unsigned short __kernel_dev_t即可。
也可以在my_dev_t.h这个头文件里面加就可以了。
发表于 2003-10-13 00:36:35 | 显示全部楼层
少头文件.
kernel-header装了没?
 楼主| 发表于 2003-10-13 08:34:37 | 显示全部楼层
已经装了,看了一下就是几个头文件的。
loop.h-->my_dev_t.h
-><linux/posix_types.h>
-><asm/posix_types.h>
这个就是它们的查找头文件的关系。但是到了最后面却没有了那个变量,本来应该是在最后面的那个文件里面有的。
所以查看了一下上下文,将__kernel_dev_t定义成unsigned short
这样不可以编译通过了。
发表于 2003-10-13 09:47:33 | 显示全部楼层
impossible!我也编译了啊,都很正常的.你的内核是什么版本的啊?
 楼主| 发表于 2003-10-13 10:37:13 | 显示全部楼层
2.6.0-test7的头文件。
glibc-2.3-20031012
gcc-3.3.1
binutils-2.14.90.0.6

有可能是2.4系列就有了。你看看,我没有2.4的内核。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表