LinuxSir.cn,穿越时空的Linuxsir!

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

新手求教

[复制链接]
发表于 2005-11-18 18:44:15 | 显示全部楼层 |阅读模式
编译GCC时出现错误,请指教
lfs:/mnt/lfs/sources/gcc-build$../gcc-3.4.3/configure --prefix=/tools \
>     --libexecdir=/tools/lib --with-local-prefix=/tools \
>     --disable-nls --enable-shared --enable-languages=c
loading cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for a BSD compatible install... (cached) /usr/bin/install -c
*** This configuration is not supported in the following subdirectories:
     target-libstdc++-v3 target-libf2c target-libffi target-boehm-gc target-zlib target-libjava zlib fastjar target-libobjc
    (Any other directories should still work fine.)
/mnt/lfs/tools/bin/../lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
*** The command 'gcc -o conftest -g -O2   conftest.c' failed.
*** You must set the environment variable CC to a working compiler.
发表于 2005-11-18 19:12:12 | 显示全部楼层
ld: cannot find -lc

    You get a message early in chapter 5 (LFS-4.1) or at the first pass of gcc (LFS CVS) which ends like this:

    -static -o gengenrtl \ gengenrtl.o ../libiberty/libiberty.a
    ld: cannot find -lc
    collect2: ld returned 1 exit status

    Your host system is probably Mandrake 9 or higher. By default, its base system does not have a static C library (/usr/lib/libc.a) which is required for the static compilation of packages.

    You need to install the glibc-static-devel RPM, which is on the third CD. You can verify the succesfull installation by verifying that /usr/lib/libc.a exists. If you're using LFS 4.1, check that everything in $LFS/static/bin is built static by using file $LFS/static/bin/*. If a package is not statically linked, reinstall it with the instructions from chapter 5.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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