[fpc-pascal]Linking problem

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Tue Jan 14 23:09:11 CET 2003

On Tue, 14 Jan 2003, Kassai Istvan wrote:

> Hello!
> I'm sure this isn't a big problem, but I can't compile any  example
> programs eg. postgres and mysql related ones.
> If I'm trying to compile the testpg1.pp (from examples) the linker gives
> this message. What does it mean, and what can I do to eliminate it?
> ---------------------------------------
> Free Pascal Compiler version 1.0.6 [2002/05/23] for i386
> Copyright (c) 1993-2002 by Florian Klaempfl
> Target OS: Linux for i386
> Compiling ./testpg1.pp
> Assembling testpg
> Linking testpg1
> /usr/bin/ld: cannot find -lpq
> testpg1.pp(106,7) Error: Error while linking
> Closing script ppas.sh
> ----------------------------------------
> And if I want to compile the mysql sample, the message is the next:
> ----------------------------------------
> Assembling qtest
> Linking testdb
> /usr/bin/ld: cannot find -lmysqlclient
> testdb.pp(84,3) Error: Error while linking
> Closing script ppas.sh
> -----------------------------------------
> What have I set up yet????

You should install the mysql-devel and postges-devel packages. This will
create a symbolic link from the libmysqlclient.so
file to the installed libmysqlclient.so.xx.yy.zz

Also, check that libmysqlclient.so.xx.yy.zz is installed in /usr/lib,
if it is not, look for it and pass  the location on to the compiler using
the -Fl/path/to/libmysqlclient option.


More information about the fpc-pascal mailing list