Copy libstdc++.so.5.0.7 to /lib32

sudo ln -s libstdc++.so.5.0.7 libstdc++.so.5

 Running 32-bit Binaries on 64-bit Ubuntu

We have just upgraded to Ubuntu 14.04 LTS for our Android development machine. When I execute the 'aapt' program as part of Android compilation, I have received the following error message:

  $ aapt
  aapt: error while loading shared libraries:
  libstdc++.so.6: cannot open shared object file:
  No such file or directory

That usually means aapt cannot execute, because libstdc++.so.6 is not installed. But you'll find that it is installed. The error message is cryptic. In reality, the 64-bit version of libstdc++.so.6 is installed. aapt is linked against the 32-bit library, which is not installed.

On Ubuntu 13.10 and prior, you can issue the following simple command to install 32-bit libraries:

  sudo apt-get install ia32-libs

But that doesn't work on Ubuntu 14.04 LTS. Apparently ia32-libs has been obsoleted. To do the same thing on Ubuntu 14.04 LTS, it takes a little more work. You have to issue the following commands in sequence:

  sudo dpkg --add-architecture i386
  sudo apt-get update
  sudo apt-get install libc6:i386
  sudo apt-get install libncurses5:i386
  sudo apt-get install libstdc++6:i386

Once you issue those commands, 'aapt' and other 32-bit programs will run on 64-bit Ubuntu 14.04 LTS.