我正努力通过Linux From Scratch . 我正在运行编译器:

error:string.h:没有这样的文件或目录

尝试根据Chapter 5: gcc-4.8.1-pass 1为目标系统编译gcc时 .

有关错误的更多详细信息:

-fexceptions -fnon-call-exceptions -fvisibility = hidden -DHIDE_EXPORTS /mnt/lfs/sources/gcc-build/./gcc/xgcc -B / mnt / lfs / sources / gcc-build /./ gcc / -B / tools / x86_64-lfs-linux-gnu / bin / -B / tools / x86_64-lfs-linux-gnu / lib / -isystem / tools / x86_64- lfs-linux-gnu / include -isystem / tools / x86_64-lfs -linux-gnu / sys-include -g -O2 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style -definition -isystem ./include -fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -fpic -mlong-double-80 -I . -一世 . -I ../.././ gcc -I ../../../ gcc-4.8.1 / libgcc -I ../../../ gcc-4.8.1 / libgcc / . -I ../../../ gcc-4.8.1 / libgcc /../ gcc -I ../../../ gcc-4.8.1 / libgcc /../ include -I .. /../../gcc-4.8.1/libgcc/../libdecnumber/no -I ../../../ gcc-4.8.1 / libgcc /../ libdecnumber -DHAVE_CC_TLS -DUSE_TLS -o decContext.o -MT decContext.o -MD -MP -MF decContext.dep -c ../../../gcc-4.8.1/libgcc/../libdecnumber/decContext.c ../../ ../gcc-4.8.1/libgcc/../libdecnumber/decContext.c:33:43:致命错误:string.h:没有这样的文件或目录#include / 用于strcmp / ^编译终止 . make [2]:[decContext.o]错误1 make [2]:离开目录/ mnt / lfs / sources / gcc-build / x86_64-lfs-linux-gnu / libgcc'make [1]:** [全部-target-libgcc]错误2 make [1]:离开目录/ mnt / lfs / sources / gcc-build'make:* [all]错误2

可能有用的其他信息:

  • 我用gcc 4.8.1运行ubuntu linux

  • 我已经安装了build-essential软件包,它是最新版本

  • 文件string.h存在

在此先感谢您的帮助 .

这是我正在运行的代码:

../gcc-4.8.1/configure                               \
    --target=$LFS_TGT                                \
    --prefix=/tools                                  \
    --with-sysroot=$LFS                              \
    --with-newlib                                    \
    --without-headers                                \
    --with-local-prefix=/tools                       \
    --with-native-system-header-dir=/tools/include   \
    --disable-nls                                    \
    --disable-shared                                 \
    --disable-multilib                               \
    --disable-decimal-float                          \
    --disable-threads                                \
    --disable-libatomic                              \
    --disable-libgomp                                \
    --disable-libitm                                 \
    --disable-libmudflap                             \
    --disable-libquadmath                            \
    --disable-libsanitizer                           \
    --disable-libssp                                 \
    --disable-libstdc++-v3                           \
    --enable-languages=c,c++                         \
    --with-mpfr-include=$(pwd)/../gcc-4.8.1/mpfr/src \
    --with-mpfr-lib=$(pwd)/mpfr/src/.libs

然后它打破 make . 我正在从 $LFS/sources/gcc-build 执行此命令 . gcc-4.8.1 位于 $LFS/sources .