繁体   English   中英

从源代码编译gcc时如何解决“cstring:没有这样的文件或目录”?

[英]How to solve “cstring: No such file or directory” when compiling gcc from source?

我试图从源代码编译gcc因为我不能使用yum,apt-get等等。 我的步骤很简单:

- 我在我的电脑上下载源GCC(我试过gcc-4.8.4和gcc-5.3.0)我用过:

  ./contrib/download_prerequisites

- 之后,我使用powerPC和Linux将我的gcc源文件发送到我的系统。

  mkdir objdir
  cd objdir 
  ../gcc-4.6.2/configure --prefix=/usr --enable-languages=c,c++,fortran,go
  make

我有下一个错误:

   In file included from ../../gcc-4.9.2/gcc/genmddeps.c:19:0:
   ../../gcc-4.9.2/gcc/system.h:205:20: fatal error: cstring: No such file or directory
   # include <cstring>
                ^
   compilation terminated.
   make[3]: *** [build/genmddeps.o] Error 1
   make[3]: Leaving directory `/home/root/build/gcc'
   make[2]: *** [all-stage1-gcc] Error 2
   make[2]: Leaving directory `/home/root/build'
   make[1]: *** [stage1-bubble] Error 2
   make[1]: Leaving directory `/home/root/build'
   make: *** [all] Error 2

关于它出了什么问题的任何想法?

最好的祝福

一些建议:首先,编译(特别是出于学习目的)比GCC 简单的东西,例如GNU make,如果你从未从源代码编译GNU的东西。

然后编译一个最近的 GCC(2016年1月5.3) - 建筑问题与4.8相同,而GCC 5更好! 您需要gcclibc-devg++libstdc++-dev用于您的主机 (运行您未来的交叉编译器)。 我不确定你的--prefix=/usr是个好主意。 考虑一下--program-suffix=-mine选项(否则,您的系统的/usr/bin/gcc可能会被覆盖,您不希望发生这种情况)

你可以保留默认的--prefix=/usr/local ,然后在你的PATH适当添加/usr/local/bin/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM