在linux配置GCC出错是什么原因

来源:百度知道 编辑:UC知道 时间:2024/05/30 06:17:55
% ${srcdir}/configure --prefix=${destdir} [其它选项]

例如,如果想将GCC 3.4.0安装到/usr/local/gcc-3.4.0目录下,则${destdir}就表示这个路径。

在我的机器上,我是这样配置的:

% ../gcc-3.4.0/configure --prefix=/usr/local/gcc-3.4.0 --enable-threads=posix --disable-checking --enable--long-long --host=i386-redhat-linux --with-system-zlib --enable-languages=c,c++,java
在命令运行后
出现了这个错误configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking build system type... i686-pc-linux-gnulibc1
checking host system type... i386-redhat-linux-gnu
checking target system type... i386-redhat-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for i386-redhat-linux-gcc... no
checking for gcc... gcc
checking for C compiler default output file name... configure: erro

我错了一点, 你的系统中没有gcc吧,gcc编译需要一个gcc的存在才行, 否则就只能自举 ,所以你最好还是安装gcc的2进制包

另外 没有特别的必要不建议使用gcc的java支持,最好安装官方的jdk

你把指定的--host=i386-redhat-linux参数去掉

--host用来描述宿主系统的编译器 你的宿主系统编译器是 i686-pc-linux-gnulibc1 你加上这个自然显示 checking for i386-redhat-linux-gcc... no 找不到 i386-redhat-linux-gcc , 去掉这个选项,即可

检查一下权限