www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Has anyone successfully used D (or even DMC) with MySQL on Windows?

reply Don Clugston <dac nospam.com.au> writes:
There's a DBI project on dsource with a port of the mysqlclient headers;
but as far as I can tell, it's only been used on Linux.
The mysqlclient.lib that comes with MySQL is a MSVC6 file (it's a static 
COFF library, not an import lib). So it's not possible to link it.

The source is available, so it should be possible to recompile with DMC.
So, I've downloaded the MySQL source. But, the project file is a 
horrible mess, there isn't a sensible makefile.  I think it would be 
necessary to make a makefile manually. I have VC6 installed on this 
machine, so I can check the settings.

But it looks as though porting it would be an unpleasant experience. 
(and it would need to be redone with new releases of MySQL). Has anyone 
already done it? Or is there another alternative?
Jan 03 2006
next sibling parent reply Don Clugston <dac nospam.com.au> writes:
Don Clugston wrote:
 There's a DBI project on dsource with a port of the mysqlclient headers;
 but as far as I can tell, it's only been used on Linux.
 The mysqlclient.lib that comes with MySQL is a MSVC6 file (it's a static 
 COFF library, not an import lib). So it's not possible to link it.
 
 The source is available, so it should be possible to recompile with DMC.
 So, I've downloaded the MySQL source. But, the project file is a 
 horrible mess, there isn't a sensible makefile.  I think it would be 
 necessary to make a makefile manually. I have VC6 installed on this 
 machine, so I can check the settings.
 
 But it looks as though porting it would be an unpleasant experience. 
 (and it would need to be redone with new releases of MySQL). Has anyone 
 already done it? Or is there another alternative?
Problem solved. For future reference: I used the Manfred Hansen's Linux database bindings mentioned on Wiki4D, (Note: you need to change extern(C) to extern(Windows)), then use the new coffimplib tool to create an OMF .lib for the libmySQL.dll file. Ignore the libmyclient.lib completely.
Jan 03 2006
next sibling parent Manfred Hansen <manfred toppoint.de> writes:
Don Clugston wrote:

 Don Clugston wrote:
 There's a DBI project on dsource with a port of the mysqlclient headers;
 but as far as I can tell, it's only been used on Linux.
 The mysqlclient.lib that comes with MySQL is a MSVC6 file (it's a static
 COFF library, not an import lib). So it's not possible to link it.
 
 The source is available, so it should be possible to recompile with DMC.
 So, I've downloaded the MySQL source. But, the project file is a
 horrible mess, there isn't a sensible makefile.  I think it would be
 necessary to make a makefile manually. I have VC6 installed on this
 machine, so I can check the settings.
 
 But it looks as though porting it would be an unpleasant experience.
 (and it would need to be redone with new releases of MySQL). Has anyone
 already done it? Or is there another alternative?
Problem solved. For future reference: I used the Manfred Hansen's Linux database bindings mentioned on Wiki4D, (Note: you need to change extern(C) to extern(Windows)), then use the new coffimplib tool to create an OMF .lib for the libmySQL.dll file. Ignore the libmyclient.lib completely.
I will make an advice on my hompage. Thank you Don Manfred
Jan 03 2006
prev sibling parent reply S. Chancellor<dnewsgr mephit.kicks-ass.org> writes:
Don Clugston <dac nospam.com.au> wrote:
Don Clugston wrote:
 There's a DBI project on dsource with a port of the mysqlclient headers;
 but as far as I can tell, it's only been used on Linux.
 The mysqlclient.lib that comes with MySQL is a MSVC6 file (it's a static 
 COFF library, not an import lib). So it's not possible to link it.
 
 The source is available, so it should be possible to recompile with DMC.
 So, I've downloaded the MySQL source. But, the project file is a 
 horrible mess, there isn't a sensible makefile.  I think it would be 
 necessary to make a makefile manually. I have VC6 installed on this 
 machine, so I can check the settings.
 
 But it looks as though porting it would be an unpleasant experience. 
 (and it would need to be redone with new releases of MySQL). Has anyone 
 already done it? Or is there another alternative?
Problem solved. For future reference: I used the Manfred Hansen's Linux database bindings mentioned on Wiki4D, (Note: you need to change extern(C) to extern(Windows)), then use the new coffimplib tool to create an OMF .lib for the libmySQL.dll file. Ignore the libmyclient.lib completely.
Are you planning to write some kind of class wrapper for it? The C api is not very friendly to quick development. I ask, because I was just about to start writing something for a project i'm doing using manfred's interface. -S. Chancellor -- Email works.
Jan 03 2006
parent Don Clugston <dac nospam.com.au> writes:
S. Chancellor wrote:
 Don Clugston <dac nospam.com.au> wrote:
 
Don Clugston wrote:

There's a DBI project on dsource with a port of the mysqlclient headers;
but as far as I can tell, it's only been used on Linux.
The mysqlclient.lib that comes with MySQL is a MSVC6 file (it's a static 
COFF library, not an import lib). So it's not possible to link it.

The source is available, so it should be possible to recompile with DMC.
So, I've downloaded the MySQL source. But, the project file is a 
horrible mess, there isn't a sensible makefile.  I think it would be 
necessary to make a makefile manually. I have VC6 installed on this 
machine, so I can check the settings.

But it looks as though porting it would be an unpleasant experience. 
(and it would need to be redone with new releases of MySQL). Has anyone 
already done it? Or is there another alternative?
Problem solved. For future reference: I used the Manfred Hansen's Linux database bindings mentioned on Wiki4D, (Note: you need to change extern(C) to extern(Windows)), then use the new coffimplib tool to create an OMF .lib for the libmySQL.dll file. Ignore the libmyclient.lib completely.
Are you planning to write some kind of class wrapper for it? The C api is not very friendly to quick development. I ask, because I was just about to start writing something for a project i'm doing using manfred's interface. -S. Chancellor
I wasn't planning on writing anything myself, but if someone else does, I'll use it :-). The DBI project on Dsource.org was rescued from oblivion last week, and is looking for a new owner. At the very least, it might give you some ideas.
Jan 04 2006
prev sibling parent bobef <bobef lessequal.com> writes:
Don Clugston wrote:
 There's a DBI project on dsource with a port of the mysqlclient headers;
 but as far as I can tell, it's only been used on Linux.
 The mysqlclient.lib that comes with MySQL is a MSVC6 file (it's a static 
 COFF library, not an import lib). So it's not possible to link it.
 
 The source is available, so it should be possible to recompile with DMC.
 So, I've downloaded the MySQL source. But, the project file is a 
 horrible mess, there isn't a sensible makefile.  I think it would be 
 necessary to make a makefile manually. I have VC6 installed on this 
 machine, so I can check the settings.
 
 But it looks as though porting it would be an unpleasant experience. 
 (and it would need to be redone with new releases of MySQL). Has anyone 
 already done it? Or is there another alternative?
I think there are sqllite bindings on dprogramming.com if this can help...
Jan 04 2006