+ -
当前位置:首页 → 问答吧 → 哪位高手 帮忙看下:LFS Linux-2.6.22.5 API Headers 出错

哪位高手 帮忙看下:LFS Linux-2.6.22.5 API Headers 出错

时间:2009-07-09

来源:互联网

lfs:/mnt/lfs/sources/linux-2.6.22.5$ make headers_check
CHK include/linux/version.h
UPD include/linux/version.h
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
HOSTCC scripts/unifdef
scripts/unifdef.c:209: error: conflicting types for 'getline'
/usr/include/stdio.h:655: error: previous declaration of 'getline' was here
make[1]: *** [scripts/unifdef] Error 1
make: *** [headers_install] Error 2
附上:
scripts/unifdef.c: 209:static Linetype getline(void);
/usr/include/stdio.h:655:extern _IO_ssize_t getline (char **__restrict __lineptr,
size_t *__restrict __n,
FILE *__restrict __stream) __wur;

在fedora 11下做的,重复做了几次都是出现这个错 前面步骤都是一步一步来的没错 俄。谢谢哪位高手 帮下。

作者: wuse   发布时间: 2009-07-09

我怀疑是不是fedora 11的问题 ,因为我在fedora 10 下做没问题。
而且因为只是lfs的前面的几步,我反复认真做了几遍,都是这个编译出错。有哪位大哥在fc 11下编译通过这步的吗?
如果有空,希望你们能试一下。

作者: wuse   发布时间: 2009-07-10

我基本上可以肯定于fc11有关,fc10 没错我实验过 。
但不知道怎么改
版主能解决下 么?

作者: wuse   发布时间: 2009-07-11

我的也是这样,看来是Fedora11 的问题啊

作者: hyqhyq_3   发布时间: 2009-07-16

楼主在做哪版的 LFS?

如果用 F10 或以上做宿主,LFS 系统的版本最好是 6.3 或以上

作者: d00m3d   发布时间: 2009-07-22

版本是6.3的,fc11

作者: wuse   发布时间: 2009-07-23

please try rename all getline to get_line or something like in scripts/unifdef.c,
there is a patch, but i can not find it now. it may help.

作者: scupan   发布时间: 2009-07-24

必要时可试换个内核的版本看看

作者: d00m3d   发布时间: 2009-07-25

fedora 11 使用的是 gcc-4.4,相应的您应使用最新的内核,或给系统 gcc 降级。

您不读手册前几章么?

作者: 聚焦深空   发布时间: 2009-07-25

引用:
作者: wuse
lfs:/mnt/lfs/sources/linux-2.6.22.5$ make headers_check
CHK include/linux/version.h
UPD include/linux/version.h
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
HOSTCC scripts/unifdef
scripts/unifdef.c:209: error: conflicting types for 'getline'
/usr/include/stdio.h:655: error: previous declaration of 'getline' was here
make[1]: *** [scripts/unifdef] Error 1
make: *** [headers_install] Error 2
附上:
scripts/unifdef.c: 209:static Linetype getline(void);
/usr/include/stdio.h:655:extern _IO_ssize_t getline (char **__restrict __lineptr,
size_t *__restrict __n,
FILE *__restrict __stream) __wur;

在fedora 11下做的,重复做了几次都是出现这个错 前面步骤都是一步一步来的没错 俄。谢谢哪位高手 帮下。
这个只需要
[root@mydream-arch linux-2.6.27.4]# vi /usr/include/stdio.h
在第651行中把getline改成get_line即可,改完后就是下面这个样子

extern _IO_ssize_t get_line (char **__restrict __lineptr,
size_t *__restrict __n,
FILE *__restrict __stream) __wur;

作者: corbin   发布时间: 2009-09-24

getline 已加入 POSIX 2008 中了, glibc-2.10.1 中也就是默认能用的了..

作者: Vamperor   发布时间: 2009-09-24