[fpc-pascal]Error compiling testdb.pp example (mysql)

James Mills prologic at daisy.ods.org
Sun Jun 15 13:14:34 CEST 2003


On Sun, Jun 15, 2003 at 12:34:07PM +0200, Michael.VanCanneyt at Wisa.be wrote:
> 
> 
> On Sun, 15 Jun 2003, James Mills wrote:
> 
> > On Sat, Jun 14, 2003 at 06:30:09PM +0200, Michael.VanCanneyt at Wisa.be wrote:
> > >
> > >
> > > On Sun, 15 Jun 2003, James Mills wrote:
> > >
> > > > On Sat, Jun 14, 2003 at 05:01:38PM +0200, Michael.VanCanneyt at Wisa.be wrote:
> > > > >
> > > > >
> > > > > On Sun, 15 Jun 2003, James Mills wrote:
> > > > >
> > > > > > On Sat, Jun 14, 2003 at 04:08:38PM +0200, Michael.VanCanneyt at Wisa.be wrote:
> > > > > > >
> > > > > > >
> > > > > > > On Sat, 14 Jun 2003, James Mills wrote:
> > > > > > >
> > > > > > > > $ fpc testdb
> > > > > > > > Free Pascal Compiler version 1.0.6 [2002/08/10] for i386
> > > > > > > > Copyright (c) 1993-2002 by Florian Klaempfl
> > > > > > > > Target OS: Linux for i386
> > > > > > > > Compiling testdb.pas
> > > > > > > > Assembling qtest
> > > > > > > > Linking testdb
> > > > > > > > testdb.o(.text+0xaa): In function `program_init':
> > > > > > > > : undefined reference to `mysql_connect'
> > > > > > > > testdb.pas(84,3) Error: Error while linking
> > > > > > > > Closing script ppas.sh
> > > > > > > >
> > > > > > > > What have I done wrong here ? ...
> > > > > > > > Yes I have installed the appropiate libmysqlclient-dev (from debian).
> > > > > > >
> > > > > > > It is not the correct version of mysql. Please check what the mysql_version
> > > > > > > unit reports as a version, and what the version is of the installed mysql.
> > > > > >
> > > > > > How on earth do I do that :P ?
> > > > >
> > > > > Simple:
> > > > >
> > > > > program ver;
> > > > >
> > > > > uses mysql_version;
> > > > >
> > > > > begin
> > > > >   Writeln(MYSQL_SERVER_VERSION);
> > > > > end.
> > > >
> > > > Okay I didn't know such a unit existed :)
> > > >
> > > > Here's the info you wanted...
> > >
> > > Correction: the info which you need :-)
> > >
> > > Seems that you have mysql version 4 installed.
> > > The units we distribute standard work with MySQL 3.23.
> > >
> > > There are units for mysql version 4 as well, but you must compile and
> > > install them separately. Get the sources of the packages , and look in
> > > packages/base/mysql/mysql4
> > >
> > > I warn against using mysql with FPC. Their API changes quite often in
> > > incompatible ways, which can be masked with C macros but which cannot
> > > be masked with Pascal functions.
> > >
> > > Try and use firebird instead is my usual advice.
> >
> > What about sqlite ? Has anyone gotten that to work in any application
> > they've developed.
> 
> I don't know of any report. But if you want to give it a try,
> I just converted the C headers for it, I can send them to you.

Please :) I would love them as I have no idea how to convert C headers
myself. Need to learn one day...
All I have here is a pascal unit for beos but it either doesn't work, or
there's a in sqlite (which I completely doubt). If you want to have a
look at that, search for: "sqlite beos pascal" on google.

But yeah, please send them :)

cheers
James

> 
> Michael.
> 
> 
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal

-- 
-
- James Mills
Zero Defect Software Engineers Group - ZDSEG




More information about the fpc-pascal mailing list