[fpc-pascal]fpc and MySQL

Michael Van Canneyt michael.vancanneyt at wisa.be
Tue Aug 6 16:14:32 CEST 2002


On Tue, 6 Aug 2002, Fernando Lozano wrote:

> Marco,
>
> > > > > Using fpc 1.0.6 and MySQL 3.23.49a under Red Hat Linux 6.2, everything
> > > > > installed from rpm packages. When I try to compile a simple program
> > > > > usign the mysql unit I get the error:
> > > > >
> > > > > bash$ fpc testemysql.pas -Fl/usr/lib/mysql
> > > > > 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 testemysql.pas
> > > > > Assembling testemysql
> > > > > Linking testemysql
> > > > > /usr/lib/mysql//libmysqlclient.a(my_compress.o): In function
> > > > > `my_uncompress':
> > > > > my_compress.o(.text+0xaa): undefined reference to `uncompress'
> > > > > /usr/lib/mysql//libmysqlclient.a(my_compress.o): In function
> > > > > `my_compress_alloc':
> > > > > my_compress.o(.text+0x13c): undefined reference to `compress'
> > > > > testemysql.pas(55) Error: Error while linking
> > > > > Closing script ppas.sh
> > > > > bash$
> > > >
> > > > Can you send the contents of link.res ?
> > >
> > > Here it is.
> >
> > Maybe zlib is missing, some distro's have zlib in libc, some not.
>
> But adding -lz to the command line don't solve the problem. :-(

Adding -lz to the compiler command-line is useless. This will only
display the logo of the compiler.

try adding
{$linklib z}
to your program source code.

Michael.





More information about the fpc-pascal mailing list