Home  >  Q&A  >  body text

centos下编译gcc的时候报错,没有c编译器

我通过如下的方式在centos下编译安装gcc

wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-4.9.1/gcc-4.9.1.tar.gz
tar zxvf gcc-4.9.1.tar.gz
cd gcc
./contrib/download_prerequisites
mkdir gcc-bulid
../gcc/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib

感觉有点矛盾,想要安装c/c++编译器,然后需要c编译器

不知大家有没有什么遇到过或者知道有什么解决方案的呢?
在一些帖子上有用yum安装gcc是很方便,但是还是喜欢折腾下,看有没有其他的方案!

淡淡烟草味淡淡烟草味2733 days ago867

reply all(3)I'll reply

  • 黄舟

    黄舟2017-04-25 09:03:10

    The first version of the C compiler must have been written in assembly. Later, it was rewritten in C when a usable binary version was available. This achieved "self-support", similar to git.

    Generally, Linux distributions come with GCC, so don’t worry, just use yum.

    reply
    0
  • 为情所困

    为情所困2017-04-25 09:03:10

    Of course you can use yum to install the packaged GCC directly, but if you want to compilea GCC yourself... there is no other way... you always need a GCC to compile a new GCC with this GCC.

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-04-25 09:03:10

    If you want to compile gcc, you must first have g++ to compile the gcc code...
    This is an unsolvable "chicken-and-egg" problem.

    reply
    0
  • Cancelreply