I need to install the 32-bit version of libstdc++.so.6 on a 64 bit Ubuntu 8.04.2 server.

when i tried apt-get install ia32-libs, it says

root@devserver:~/downloads# apt-get install ia32-libs
Reading package lists... Done
Building dependency tree
Reading state information... Done
ia32-libs is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 133 not upgraded.

But when i tried to enable a PHP extension (libpdf_php.so), which uses this runtime library following error is logged in php error log.

root@devserver:~/downloads# cat /var/log/apache2/php_error.log
[01-Nov-2011 16:54:09] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613/libpdf_php.so' - /usr/lib/php5/20060613/libpdf_php.so: wrong ELF class: ELFCLASS32 in Unknown on line 0

What makes you think you need a 32-bit version of libstdc++.so.6?

64-bit Ubuntu runs 64-bit Apache which runs 64-bit PHP which it seems can't load 32-bit libpdf_php.so, which it tells you in the error message.

It's unlikely that installing ia32-libs will solve the problem - I would say you need 64-bit version of libpdf_php.so

It looks like pdflib's website has a separate download for x86-64 architecture - I downloaded the archive and the .so file inside it is definitely 64-bit.


You could've used apt-get install lib32stdc++6.

  • 2
    This answered the question in the title (How to install 32-bit version of libstdc++.so.6 on a 64 bit machine) to me. – setempler Aug 19 '14 at 0:59
  • Hi, When I run sudo apt-get install lib32stdc++6 its give me o/p like : The following NEW packages will be installed: lib32stdc++6 But, when I run ls /usr/lib32 Its not exist. Please let me know where I am wrong. Thanks. – AB Bolim Jul 22 '15 at 7:03
  • This helped me get bison running for an Android source build on Ubuntu 14.04. – bonh Aug 27 '15 at 3:24
  • 1
    I had to add the :i386 after the package name (I actually wanted the 32 bit version of libstdc++.so.5: apt-get install libstdc++5:i386) – Steven C. Howell Jan 7 '16 at 19:32

The problem is not with libstdc++, it's with libpdf_php.so. You need to download the 32-bit version of that library.

protected by Community Feb 11 '17 at 17:13

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.