Home Help Center

Compilation Problem with GCC

mykaelmykael Member

On a new machine I have gcc 4.0.0 and when I want to compile Ice I have an error which I do not have with gcc 3.4.3.
In the INSTALL.LINUX, you said that to compile Ice it is possible to use gcc 3.2, 3.3, 3.4, 4.01 or later. So I have installed the latest version 4.1.1 with the latest version of bunutils.
But when I do this, I can't compile DB Berkley I have something like this :
libstdc++.so : could not read symbols: File in wrong format.
I don't understand why It cannot read this lib because I compile it installing the new gcc.
To compile gcc and binutils I made that in the usual way (configure with prefix, make, make install)

If anyone has an idea...



  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff

    There was a bug in GCC 4.0.0 which prevented to compile Ice. I'm not sure why you're getting this error but it looks like your GCC build is wrong somehow or perhaps you forgot to add /opt/gcc-4.1.1/lib to your LD_LIBRARY_PATH if you built libstdc++ as a shared library?

    To build gcc, I usually do the following:
    $ tar -zxvf gcc-4.0.1.tar.gz
      $ mkdir gcc-build
      $ cd gcc-build
      $ ../gcc-4.0.1/configure --prefix=/opt/gcc-4.0.1 --enable-shared --enable-threads --enable-languages=c,c++
      $ make bootstrap
      $ make install

    Then, I add /opt/gcc-4.0.1/lib to my LD_LIBRARY_PATH and /opt/gcc-4.0.1/bin to my PATH. I also don't recompile binutils (in general the installed version works just fine).

    Hope this helps!

Sign In or Register to comment.