I'm trying to build the i386 version of the fontconfig packages, and the configure script fails to find the expat library, which is installed for both architectures. The failing test app build command:

> gcc-4.8 -m32 -o conftest expat.test.c -lexpat 
/usr/bin/ld: cannot find -lexpat
collect2: error: ld returned 1 exit status
Exit 1
ldd: ./conftest: No such file or directory

Yet when I pass in the library's full path instead of -lexpat, the command succeeds:

> gcc-4.8 -m32 -o conftest expat.test.c /lib/i386-linux-gnu/libexpat.so.1 ; ldd conftest
    linux-gate.so.1 =>  (0xf7759000)
    libexpat.so.1 => /lib/i386-linux-gnu/libexpat.so.1 (0xf76f8000)
    libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7549000)
    /lib/ld-linux.so.2 (0xf775a000)

The lib32gcc-4.8-dev package is installed.

Could this be related to the fact that I had to make manual i686-linux-gnu-objcopy and ditto-strip symlinks to /usr/bin/{objcopy,strip} and was also missing an i686-linux-gnu-gcc command?

2 Answers 2


I was having the exact same issue on 64-bit linux. It resolved by installing expat1-dev for 32-bit

Here is the command

sudo apt-get install libexpat1-dev:i386

I found an even better solution: I created my own PPA on launchpad. You jump through the hoops only once to set up a key and install the required additional packages, but then you can rely on the buildbots to install the 32bit requirements whenever 32bit builds are required. They solved that issue by using 64bit and 32bit virtual machines, that way they don't run into multiarch conflicts or glitches.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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