RE: [ROOT] How to use MySQL on Windows system

From: Andrei Daniel (daniel@jinr.ru)
Date: Tue Nov 13 2001 - 12:05:19 MET


When I compiled a simple code like next

TROOT root("rint", "The ROOT Interactive Interface");

int main(int argc, char **argv)
{
	TRint *app = new TRint("App",&argc,argv,0,0);
	app->Run();
	return 0;
}

with MySQLServer.cpp, MySQLResult.cpp, MySQLRow.cpp,
MySQLcint.cpp and linked result with library from MySQL database
all is working excluding TSQLRow operator[]. Last operator must return
result of method GetField(field) but it returns strange large integer
number.
Method GetField works fine itself.

But when I organized DLL library from these codes and tried to load it
by gSYSTEM->Load() the returned code was –1. What is a difference?
Compiler gave the warnings that TSQLServer, TSQLResult and TSQLRow
are not linked as DLL. In principal, now I can use first way and translate
these classes each time when they are necessary. But question remains.

Andrei Daniel



-----Original Message-----
From: rdm@pcsalo.cern.ch [mailto:rdm@pcsalo.cern.ch]On Behalf Of Fons
Rademakers
Sent: Tuesday, November 13, 2001 12:05 PM
To: Andrei Daniel
Cc: Roottalk
Subject: Re: [ROOT] How to use MySQL on Windows system


No need to rebuild complete ROOT you only should rebuild the
libMySQL.lib and .dll. If you have pure Win32 version of libmysqlclient
then there is no need of course to run with libcygwin.dll.

Cheers, Fons.



Andrei Daniel wrote:
>
> Thanks.
> What is a difference between library libmysqlclient for cygwin and
libraries
> mysqlclient and libmySQL distributing with MySQL database. Linker found
> all external references. Previously I created own classes and DLL
libraries
> that could be loaded dynamically from ROOT. It was a fine property
> of ROOT. Why it is necessary to rebuild ROOT now?
>
> Andrei Daniel
>
> -----Original Message-----
> From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On
> Behalf Of Fons Rademakers
> Sent: Monday, November 12, 2001 8:41 PM
> To: Andrei Daniel
> Cc: Roottalk
> Subject: Re: [ROOT] How to use MySQL on Windows system
>
> You should get a MySql client library for Windows (libmysqlclient)
> and then rebuild ROOT on Windows. You can find such a lib for
> the cygwin environment (but this requires them cygwin.dll to run
> ROOT with mysql).
>
> Cheers, Fons.
>
> Andrei Daniel wrote:
> >
> > Hi Rooters,
> >
> > Who used MySQL database in the root on the Windows system.
> > libMySQL.dll is not included in the common distribution for
> > Windows. By this reason, I got MySQL source files from
> > the root archive, make MySQLcint.cpp by rootcint and
> > translated all files into the DLL by Visual C++ 6.0.
> >
> > 1. rootcint could not recognized __declspec(dllexport).
> > Is it correct or not. I excluded this definition on
> > the rootcint step and included it later.
> > 2. Library is created without errors but it could
> > not be loaded by gSystem->Load("libMySQL").
> >
> > Any suggestions would be helpful to me.
> >
> > Andrei
> >
> > ----------------------------------------------
> > Andrei Daniel
> > FLNR, JINR, Dubna 141980 Russia
> > e-mail: daniel@jinr.ru
> > tel: 7 (09621) 64568   fax: 7 (09621) 65083
>
> --
> Org:    CERN, European Laboratory for Particle Physics.
> Mail:   1211 Geneve 23, Switzerland
> E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
> WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7679480

--
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7679480



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:08 MET