Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2002-08

fpc and MySQL

9 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Fernando Lozano

Hi there,

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$

Sure I missed something basic, but I could not find what. O though it was zlib, but adding -lz to the command line yelds the same errors.

[]s, Fernando Lozano

Reply by email

Unknown author
to Fernando Lozano
Fernando Lozano wrote 22 lines
Hi there, 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 ?

Michael.

Reply by email

Fernando Lozano

Hi Michael,

Show quoted text 22 lines
> 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.

[]s, Fernando Lozano

Reply by email

Marco van de Voort
to Fernando Lozano
Show quoted text 24 lines
> > 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.

Reply by email

Fernando Lozano

Marco,

Show quoted text 26 lines
> > > 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. :-(

[s, Fernando Lozano

Reply by email

Michael Van Canneyt
to Fernando Lozano
Fernando Lozano wrote 30 lines
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.

Reply by email

Fernando Lozano

Hi Michael,

Show quoted text 10 lines
> > > > > `my_compress_alloc': > > > > > my_compress.o(.text+0x13c): undefined reference to `compress' > > > > > testemysql.pas(55) Error: Error while linking > > > > 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.

So there's no to add a library to the linking phase on the command line? I must use compiler directives?

[]s, Fernando Lozano

Reply by email

ron wilson
to Fernando Lozano

i am having problems with the winsock send function - i think its translating all my CR with CR/LF and i don't want it to. can someone tell me what flag to set?

 function send(s:TSocket;Const buf; len:tOS_INT;
flags:tOS_INT):tOS_INT;stdcall;
   external winsockdll name 'send';

regards,
ron wilson.

Reply by email

Unknown author
to Fernando Lozano: So there's no to add a library to the linking phase on the command line? I must use…
Fernando Lozano wrote 15 lines
Hi Michael, > > > > > > `my_compress_alloc': > > > > > > my_compress.o(.text+0x13c): undefined reference to `compress' > > > > > > testemysql.pas(55) Error: Error while linking > > > > > > 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. So there's no to add a library to the linking phase on the command line? I must use compiler directives?

No, there is:

-k-lz

The -k option can be used to pass any command-line option to the linker.

Michael.

Reply by email