Centos – No 32 development library error after install glibc-devel.i686

centosgccglibc

I am trying to install gcc 4.9.0 on centOS 6.
During ./configure there is an error coming up:

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-   linux/4.4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
configure: error: I suspect your system does not have 32-bit developement libraries (libc and headers). If you have them, rerun configure with --enable-multilib. If you do not have them, and want to build a 64-bit-only compiler, rerun configure with --disable-multilib.

I have searched for an answer and found out that this error should be resolved by installing the glibc-devel.i686 package.

However, the same error persists even after I install it using yum. Any ideas?

Best Answer

To be a tiny bit more explicit than @Miroslav answer:

1 The dependencies

#64-bit (`x86_64`) C library and headers
yum install libgcc
yum install glibc-devel

# 32-bit (‘i386’) C library and headers
yum install libgcc.i686
yum install glibc-devel.i686

See all of them in GCC Prerequesites.

2 Then compile with --enable-multilib

../configure --enable-languages=all --prefix=/usr/local/gcc --enable-multilib

Edit.

Side Note: Don't compile in the same directory, as I can see ./configure in your example. See Installing GCC

Do not run ./configure, this is not supported, you need to run configure from outside the source directory

Related Question