1

In a 64 bits systems, it fails if I try to compile a configure test with:

$ gcc -m32 -o conftest -L/usr/lib/i386-linux-gnu/ conftest.c -lfreetype /usr/bin/ld: cannot find -lfreetype collect2: ld returned 1 exit status 

but it is successful if I do:

$ gcc -m32 -o conftest conftest.c /usr/lib/i386-linux-gnu/libfreetype.so.6 

Why can't ld find 32bit libfreetype.so.6 in the first case?

1 Answer 1

3

There's a difference between the runtime and development system. The linker is looking for libfreetype.so and is not finding it. The program at runtime is looking for libfreetype.so.6 and finds it.

You should install the FreeType development package.

Before going to that much effort, though, you can validate this hypothesis by first checking that libfreetype.so does not exist in /usr/lib/i386-linux-gnu, and then by using root privileges to do:

cd /usr/lib/i386-linux-gnu ln -s libfreetype.so.6 libfreetype.so 

and then retrying the first command line.

If that works, then remove the symlink just created and then install the FreeType development package.

Sign up to request clarification or add additional context in comments.

3 Comments

I can't install libfreetype6-dev:i386 on my 64 bit system because its flawed dependencies will force apt-get get to remove gcc and other important development packages.
OK, then you can try the kludge fix. If that works for the check, you may be OK. OTOH, it is reasonably likely that the package you are configuring is going to need headers from the FreeType library, unless it is only dependent, pre-compiled packages that depend on FreeType. It is worth trying the kludge (the ln -s command I showed), at any rate. The worst that can happen is that it isn't sufficient. However, if you continue to run into problems with the FreeType library, it isn't hard to build it for yourself.
Funnily enough, I was trying to build some 32-bit software on a 64-bit machine this week, and I had to fix up several libraries each with its own symlink as described.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.