Skip to main content
It is necessary to run `apt-get update` after adding the architecture otherwise subsequent `apt` calls will fail to find the required packages. This caused me some confusion until I read the Debian Wiki article: https://wiki.debian.org/Multiarch/HOWTO
Source Link

Since Ubuntu 11.04 (natty) and Debian 7.0 (wheezy) introduced multiarch support, 32-bit and 64-bit libraries can coexist on one system. To install a 32-bit library libXX, first add the necessary 32bit architecture to your system:

sudo dpkg --add-architecture i386
sudo apt-get update

Then install the 32bit library:

sudo apt-get install libXX:i386

The ia32-libs package. As of Ubuntu 12.04 precise, it no longer contains any libraries, it only pulls in libXX:i386 packages as dependencies.

The compile part is rather easy for C and C++ programs, add -m32 to CFLAG or CXXFLAG, which will make generated program 32bit, e.g

export CFLAGS="-m32"
gcc main.c -o main

This works for makefile-based projects as well.

Since Ubuntu 11.04 (natty) and Debian 7.0 (wheezy) introduced multiarch support, 32-bit and 64-bit libraries can coexist on one system. To install a 32-bit library libXX, first add the necessary 32bit architecture to your system:

sudo dpkg --add-architecture i386

Then install the 32bit library:

sudo apt-get install libXX:i386

The ia32-libs package. As of Ubuntu 12.04 precise, it no longer contains any libraries, it only pulls in libXX:i386 packages as dependencies.

The compile part is rather easy for C and C++ programs, add -m32 to CFLAG or CXXFLAG, which will make generated program 32bit, e.g

export CFLAGS="-m32"
gcc main.c -o main

This works for makefile-based projects as well.

Since Ubuntu 11.04 (natty) and Debian 7.0 (wheezy) introduced multiarch support, 32-bit and 64-bit libraries can coexist on one system. To install a 32-bit library libXX, first add the necessary 32bit architecture to your system:

sudo dpkg --add-architecture i386
sudo apt-get update

Then install the 32bit library:

sudo apt-get install libXX:i386

The ia32-libs package. As of Ubuntu 12.04 precise, it no longer contains any libraries, it only pulls in libXX:i386 packages as dependencies.

The compile part is rather easy for C and C++ programs, add -m32 to CFLAG or CXXFLAG, which will make generated program 32bit, e.g

export CFLAGS="-m32"
gcc main.c -o main

This works for makefile-based projects as well.

The command for adding architecture is the same on Ubuntu and Debian (for current versions).
Source Link

Since Ubuntu 11.04 (natty) and Debian 7.0 (wheezy) introduced multiarch support, 32-bit and 64-bit libraries can coexist on one system. To install a 32-bit library libXX, first add the necessary 32bit architecture to your system:

For Ubuntu:

sudo dpkg --foreign-architecture i386

And for Debian:

sudo dpkg --add-architecture i386

Then install the 32bit library:

sudo apt-get install libXX:i386

The ia32-libs package. As of Ubuntu 12.04 precise, it no longer contains any libraries, it only pulls in libXX:i386 packages as dependencies.

The compile part is rather easy for C and C++ programs, add -m32 to CFLAG or CXXFLAG, which will make generated program 32bit, e.g

export CFLAGS="-m32"
gcc main.c -o main

This works for makefile-based projects as well.

Since Ubuntu 11.04 (natty) and Debian 7.0 (wheezy) introduced multiarch support, 32-bit and 64-bit libraries can coexist on one system. To install a 32-bit library libXX, first add the necessary 32bit architecture to your system:

For Ubuntu:

sudo dpkg --foreign-architecture i386

And for Debian:

sudo dpkg --add-architecture i386

Then install the 32bit library:

sudo apt-get install libXX:i386

The ia32-libs package. As of Ubuntu 12.04 precise, it no longer contains any libraries, it only pulls in libXX:i386 packages as dependencies.

The compile part is rather easy for C and C++ programs, add -m32 to CFLAG or CXXFLAG, which will make generated program 32bit, e.g

export CFLAGS="-m32"
gcc main.c -o main

This works for makefile-based projects as well.

Since Ubuntu 11.04 (natty) and Debian 7.0 (wheezy) introduced multiarch support, 32-bit and 64-bit libraries can coexist on one system. To install a 32-bit library libXX, first add the necessary 32bit architecture to your system:

sudo dpkg --add-architecture i386

Then install the 32bit library:

sudo apt-get install libXX:i386

The ia32-libs package. As of Ubuntu 12.04 precise, it no longer contains any libraries, it only pulls in libXX:i386 packages as dependencies.

The compile part is rather easy for C and C++ programs, add -m32 to CFLAG or CXXFLAG, which will make generated program 32bit, e.g

export CFLAGS="-m32"
gcc main.c -o main

This works for makefile-based projects as well.

Typo in the second sentence, OP had "23 bit" rather than "32 bit"
Source Link

Since Ubuntu 11.04 (natty) and Debian 7.0 (wheezy) introduced multiarch support, 32-bit and 64-bit libraries can coexist on one system. To install a 32-bit library libXX, first add the 23bitnecessary 32bit architecture to your system:

For Ubuntu:

sudo dpkg --foreign-architecture i386

And for Debian:

sudo dpkg --add-architecture i386

Then install the 32bit library:

sudo apt-get install libXX:i386

The ia32-libs package. As of Ubuntu 12.04 precise, it no longer contains any libraries, it only pulls in libXX:i386 packages as dependencies.

The compile part is rather easy for C and C++ programs, add -m32 to CFLAG or CXXFLAG, which will make generated program 32bit, e.g

export CFLAGS="-m32"
gcc main.c -o main

This works for makefile-based projects as well.

Since Ubuntu 11.04 (natty) and Debian 7.0 (wheezy) introduced multiarch support, 32-bit and 64-bit libraries can coexist on one system. To install a 32-bit library libXX, first add the 23bit architecture to your system:

For Ubuntu:

sudo dpkg --foreign-architecture i386

And for Debian:

sudo dpkg --add-architecture i386

Then install the 32bit library:

sudo apt-get install libXX:i386

The ia32-libs package. As of Ubuntu 12.04 precise, it no longer contains any libraries, it only pulls in libXX:i386 packages as dependencies.

The compile part is rather easy for C and C++ programs, add -m32 to CFLAG or CXXFLAG, which will make generated program 32bit, e.g

export CFLAGS="-m32"
gcc main.c -o main

This works for makefile-based projects as well.

Since Ubuntu 11.04 (natty) and Debian 7.0 (wheezy) introduced multiarch support, 32-bit and 64-bit libraries can coexist on one system. To install a 32-bit library libXX, first add the necessary 32bit architecture to your system:

For Ubuntu:

sudo dpkg --foreign-architecture i386

And for Debian:

sudo dpkg --add-architecture i386

Then install the 32bit library:

sudo apt-get install libXX:i386

The ia32-libs package. As of Ubuntu 12.04 precise, it no longer contains any libraries, it only pulls in libXX:i386 packages as dependencies.

The compile part is rather easy for C and C++ programs, add -m32 to CFLAG or CXXFLAG, which will make generated program 32bit, e.g

export CFLAGS="-m32"
gcc main.c -o main

This works for makefile-based projects as well.

Added dpkg --add-architecture
Source Link
terdon
  • 252.2k
  • 69
  • 480
  • 718
Loading
deleted 11 characters in body
Source Link
tshepang
  • 67.7k
  • 94
  • 226
  • 297
Loading
state the minimum required versions (wheezy isn't even released yet)
Source Link
Gilles 'SO- stop being evil'
  • 865.3k
  • 205
  • 1.8k
  • 2.3k
Loading
Source Link
daisy
  • 55.9k
  • 80
  • 253
  • 402
Loading