[fpc-devel] LinkLib Issues In Lazarus and in FPC-2.0.2

Marco van de Voort marcov at stack.nl
Mon Jul 17 10:04:15 CEST 2006

> Greetings to the Fpc-Devel list:
> the following libraries were not found by ld: glib12, gdk12, and gtk12.

This is a know issue without good solution, since the problem originates in
the FreeBSD ports management.

The best solution is:

- for 2.0.2  manually create relevant symlinks to the libs.
- for 2.0.4, use linkaliasing 

> Funny! I moved away from Linux mainly because of Library-Hell issues :-)

Me too. I really hate the mentality behind this change. It made me
reconsider my stance on ports tree usage of FPC. (read: give it up)

(from a mail to sb else explaining this, I'll be adding this to the wiki
today in a modded form):

What happens is that all xxx12 libs were renamed to xxx-12 (note that this
is STILL different from conventional xxx-1.2)

FreeBSD Ports put this change silently in a doc in nov 2005, and removed the
old names in feb 2006 in -STABLE, and refuses to fix the port with a symlink
and thus have a longer grace period.

The only way you can know, inside the port building, is to test what name of
gtk lib exists (libgtk12 or libgtk-1.2, same for gdk12 and glib12). THE
to pkgconfig or keep on using the -RELEASE ports branch (which is security

Of course I can't take a tool that emits gcc parametes seriously (since
some ad hoc parsing will probably break on the first gcc change). 

So I consider calling pkgconfig/gtkconfig a way to fragile solution long
term, I decided to solve it differently, and have some form of config
options for them.

This because FPC wasn't entirely innocent too, in that library names in
sourcecode ($LINKLIB xxx) couldn't be changed after compilation, this is now
fixed in 2.0.4.

The 2.0.4 sourcecode defaults to the new library naming. If you install FPC
on a system with gtk compiled from the pre februari portstree (like a stock
6.0 release), you need to add


to the 2.0.4 fpc.cfg

It is also the most neutral choice. People that disagree with me can try to
hack up something to query pkgconfig and install that into fpc.cfg, without
risking breakage of the compiler due to some pkgconfig problem.

Note that the a 2.0.4 FreeBSD rc2 will become available today for testing.

More information about the fpc-devel mailing list