LinuxSir.cn,穿越时空的Linuxsir!

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

在第六张编译gcc3.2的时候出现下面的错误

[复制链接]
发表于 2003-5-4 19:53:51 | 显示全部楼层 |阅读模式
/usr/include/gconv.h:158: parse error before "__mbstate_t"
/usr/include/gconv.h:159: ISO C forbids data definition with no type or storage
class
/usr/include/gconv.h:164: parse error before '}' token
/usr/include/gconv.h:172: field `__data' has incomplete type
/usr/include/gconv.h:173: confused by earlier errors, bailing out
make[1]: *** [cplus-dem.o] Error 1
make[1]: Leaving directory `/usr/src/gcc-build/libiberty'
make: *** [all-libiberty] Error 2
 楼主| 发表于 2003-5-4 20:22:41 | 显示全部楼层

全帖出来,各位大哥帮帮忙啊!在线等!

/usr/include/_G_config.h:29: `__mbstate_t' undeclared (first use in this function)
/usr/include/_G_config.h:29: (Each undeclared identifier is reported only once
/usr/include/_G_config.h:29: for each function it appears in.)
/usr/include/_G_config.h:29: parse error before "__state"
/usr/include/_G_config.h: At top level:
/usr/include/_G_config.h:30: ISO C forbids data definition with no type or storage class
/usr/include/_G_config.h:34: parse error before "__mbstate_t"
/usr/include/_G_config.h:35: ISO C forbids data definition with no type or storage class
In file included from /usr/include/_G_config.h:44,
                 from /usr/include/libio.h:32,
                 from /static/lib/gcc-lib/i686-pc-linux-gnu/3.2/include/stdio.h:81,
                 from ../../gcc-3.2/libiberty/cplus-dem.c:41:
/usr/include/gconv.h:158: parse error before "__mbstate_t"
/usr/include/gconv.h:159: ISO C forbids data definition with no type or storage class
/usr/include/gconv.h:164: parse error before '}' token
/usr/include/gconv.h:172: field `__data' has incomplete type
/usr/include/gconv.h:173: confused by earlier errors, bailing out
make[1]: *** [cplus-dem.o] Error 1
make[1]: Leaving directory `/usr/src/gcc-build/libiberty'
make: *** [all-libiberty] Error 2
 楼主| 发表于 2003-5-4 22:38:04 | 显示全部楼层
就是在执行下面的命令时出错了
你必须先打补丁,才能安装这个包。确认在运行下面的命令前,补丁已经解压了。

如果你把这个包缺省的优化参数(包括 -march 和 -mcpu参数)改变的话,它会有很不良的表现。最好不要优化这个包。因此,如果你定义了任何优化参数的话,比如CFLAGS 和 CXXFLAGS,我们劝你在编译GCC时unset或修改它们。警告过了哦!

下面的命令将安装 C和C++ 编译器,所以你需要解压 gcc-core和gcc-g++两个压缩包。gcc包里还有其它的编译器,编译它们的指导请看 http://beyond.linuxfromscratch.org/view/cvs/general/gcc.html

patch -Np1 -i ../gcc-3.2.patch &&
mkdir ../gcc-build &&
cd ../gcc-build &&
../gcc-3.2/configure --prefix=/usr --enable-shared \
    --enable-threads=posix --with-slibdir=/lib \
    --enable-__cxa_atexit --enable-clocale=gnu &&
make bootstrap &&
make install &&
ln -s ../usr/bin/cpp /lib &&
ln -s ../bin/cpp /usr/lib &&
ln -s gcc /usr/bin/cc
发表于 2003-5-4 22:45:28 | 显示全部楼层
先看一看第五章里的gcc是不是静态连接的?
 楼主| 发表于 2003-5-4 22:49:49 | 显示全部楼层
我就是安照上面说的一步一步做下来的。
 楼主| 发表于 2003-5-4 22:50:20 | 显示全部楼层
怎么看?
 楼主| 发表于 2003-5-4 22:53:22 | 显示全部楼层
是不是要全部重来?
发表于 2003-5-4 23:01:50 | 显示全部楼层
不是,用ldd来看,或者用file来看:
find $LFS/static -exec file {} \; grep shared
 楼主| 发表于 2003-5-4 23:15:53 | 显示全部楼层
root:/static# ldd /static/bin/*
/static/bin/addr2line:
        not a dynamic executable
/static/bin/ar:
        not a dynamic executable
/static/bin/as:
        not a dynamic executable
/static/bin/awk:
        not a dynamic executable
/static/bin/basename:
        not a dynamic executable
/static/bin/bash:
        not a dynamic executable
/static/bin/bashbug:
        not a dynamic executable
/static/bin/bunzip2:
        not a dynamic executable
/static/bin/bzcat:
        not a dynamic executable
/static/bin/bzcmp:
        not a dynamic executable
/static/bin/bzdiff:
        not a dynamic executable
/static/bin/bzegrep:
        not a dynamic executable
/static/bin/bzfgrep:
        not a dynamic executable
/static/bin/bzgrep:
        not a dynamic executable
/static/bin/bzip2:
        not a dynamic executable
/static/bin/bzip2recover:
        not a dynamic executable
/static/bin/bzless:
是这样的。
 楼主| 发表于 2003-5-4 23:19:30 | 显示全部楼层
root:/static/bin# ldd grep
        not a dynamic executable
root:/static/bin# ldd egrep
        not a dynamic executable
root:/static/bin#
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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