How to fix the error “ wrong ELF class: ELFCLASS64” after installed GCC 4.6

Posted: May 30, 2011 in Android, Ubuntu
Tags: , , ,

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: “ wrong ELF class: ELFCLASS64”.

Don’t worry about that. You are just using a wrong architecture of the 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/ /usr/lib32
cd /usr/lib32

sudo rm
sudo ln -s
sudo ln -s
sudo ldconfig

Doing that, we copied the 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 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.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s