Posts Tagged ‘GCC 4.6’


Hello folks. If you compiled and installed GCC 4.6 and during the Android Gingerbread (or another software) compilation you received the following error message: “libstdc++.so.6: wrong ELF class: ELFCLASS64″.

Don’t worry about that. You are just using a wrong architecture of the libstdc++.so.6 in the folder /usr/lib32 in Ubuntu 64 bits. To solve that, open a terminal, go to the place where you have built GCC 4.6 and run the commands below:

sudo cp build/x86_64-unknown-linux-gnu/32/libstdc++-v3/src/.libs/libstdc++.so.6.0.16 /usr/lib32
cd /usr/lib32

sudo rm libstdc++.so.6
sudo ln -s libstdc++.so.6.0.16 libstdc++.so.6
sudo ln -s libstdc++.so.6.0.16 libstdc++.so
sudo ldconfig

Doing that, we copied the libstdc++.so.6 for 32 bits in /usr/lib32 and also updated the links to this one. Now, all software that need this lib for 32 bits will use this one for compilation.

Remember, the lib libstdc++.so.6.0.16 is the version when I compiled GCC 4.6. If you get the file recently, this version will be different. Just don’t forget to change the reference to this one.

That’s it. See you next time.


Hello folks.

After update my Ubuntu I have decided to update the GCC. This procedure follow the same posted in Installing GCC 4.6 in the Ubuntu 10.10. The only detail is about the version that was updated. Instead of use the file gcc-4.6-20110401.tar.bz2 now you must use gcc-4.6-20110429.tar.bz2.

Don’t forget to change the line:

../gcc-4.6-20110401/configure \
–disable-checking \
–enable-languages=c,c++ \
–enable-multiarch \
–enable-shared \
–enable-threads=posix \
–program-suffix=-4.6 \
–with-gmp=/usr/local/lib \
–with-mpc=/usr/lib \
–with-mpfr=/usr/lib \
–without-included-gettext \
–with-system-zlib \
–with-tune=generic

To:

../gcc-4.6-20110429/configure \
–disable-checking \
–enable-languages=c,c++ \
–enable-multiarch \
–enable-shared \
–enable-threads=posix \
–program-suffix=-4.6 \
–with-gmp=/usr/local/lib \
–with-mpc=/usr/lib \
–with-mpfr=/usr/lib \
–without-included-gettext \
–with-system-zlib \
–with-tune=generic

That`s it. See you next time.


Hello everybody. Last weekend I was compiling the Qt to build KDE. The compilation finished without problem but to generate the local API documentation, the following error occurred: GLIBCXX_3.4.15 not found.

I’ve had compiled the GCC 4.6 as shown in Installing GCC 4.6 in the Ubuntu 10.10 and when I’ve installed it, the file “libstdc++.so.6.0.15″ was not installed in “/usr/lib/”.

To solve that, copy the file from build directory (this location refer where you compiled GCC 4.6):

sudo cp gcc/build/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.15 /usr/lib/

Now, redirect the links to point to this new one:

sudo rm libstdc++.so libstdc++.so.6
sudo ln -s libstdc++.so.6.0.15 libstdc++.so
sudo ln -s libstdc++.so.6.0.15 libstdc++.so.6

Done that, the local API documentation was generated without problem.

That’s it. See you at next time.


This post is a translation about one I posted in Portuguese. This is very interesting and I decide to do that.

As usual, before to start the installation we need to install some packages that are required. Open a shell and type:

sudo apt-get install mpc libmpc-dev libmpfr-dev libppl0.10-dev libcloog-ppl-dev zlib1g zlib1g-dev libc6-dev-i386 m4 flex

Also we need to install the package gmp, however it doesn’t have in the Ubuntu’s repository. So, this one we will have to install it manually. Download it from packages.ubuntu.com and follow the procedure below to install it.

- Extract the file: tar xvf gmp_4.3.2+dfsg.orig.tar.gz
– Using a shell, access the folder uncompressed
– Run:

./configure
make
sudo make install
make check

From GNU site, download the file gcc-4.6-20110401.tar.bz2 to a folder called gcc.

Using a shell, go to gcc folder and extract the file:

tar xjvf gcc-4.6-20110401.tar.bz2

Still in gcc folder, create another folder called build:

mkdir build

Now you will have a directory structure like this:

gcc/build
gcc/gcc-4.6-20110401

Finally, it’s time to compile the GCC. Access the build folder and run:

../gcc-4.6-20110401/configure \
--disable-checking \
--enable-languages=c,c++ \
--enable-multiarch \
--enable-shared \
--enable-threads=posix \
--program-suffix=-4.6 \
--with-gmp=/usr/local/lib \
--with-mpc=/usr/lib \
--with-mpfr=/usr/lib \
--without-included-gettext \
--with-system-zlib \
--with-tune=generic
make
sudo make install

Finished the compilation, we need to say to Ubuntu to use the new GCC:

cd /usr/bin
sudo rm g++
sudo ln -s /usr/local/bin/g++-4.6 g++
sudo rm gcc
sudo ln -s /usr/local/bin/gcc-4.6 gcc

In this post, I opted to compile just “C” and “C++”, although you can add others components to be compiled according with GNU site. However, you already must have realized, I downloaded the full GNU distribution and compiled just 2 languages. I could use the option “all” in –enable-languages but I was getting error when it started to compile the Java module. I will investigate that and I will post here in this blog the solution.

That’s it folks. Any doubts or suggestion, feel free to comment. More information about how to compile GCC, you can find in GNU site.

See you next time.