www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Need OMF MySQL lib that actually f^*&^ works...

reply "Nick Sabalausky" <a a.a> writes:
Anyone have a known-working Windows OMF library for MySQL? Static or 
dynamic, I don't care. I've tried fucking everything and I can't get the 
dang thing to work. Static was a total no-go. With dynamic, using implib I 
got it to link, but calling any of it resulted in an Access Violation. Using 
coffimplib, best I could do had one linker error, a missing 
"_mysql_real_connect". This was all with "Connector/C" v6.0.2. I'd have 
tried an older version, 5.x, but 6.0.2 is the only version that seems to 
still exist.
Jul 21 2011
next sibling parent reply Robert Clipsham <robert octarineparrot.com> writes:
On 22/07/2011 07:20, Nick Sabalausky wrote:
 Anyone have a known-working Windows OMF library for MySQL? Static or
 dynamic, I don't care. I've tried fucking everything and I can't get the
 dang thing to work. Static was a total no-go. With dynamic, using implib I
 got it to link, but calling any of it resulted in an Access Violation. Using
 coffimplib, best I could do had one linker error, a missing
 "_mysql_real_connect". This was all with "Connector/C" v6.0.2. I'd have
 tried an older version, 5.x, but 6.0.2 is the only version that seems to
 still exist.

I have no experience with D on windows, have you tried using unilink though? I seem to recall that can link COFF and OMF together? -- Robert http://octarineparrot.com/
Jul 22 2011
parent reply "Nick Sabalausky" <a a.a> writes:
"Robert Clipsham" <robert octarineparrot.com> wrote in message 
news:j0ce0t$2rte$1 digitalmars.com...
 On 22/07/2011 07:20, Nick Sabalausky wrote:
 Anyone have a known-working Windows OMF library for MySQL? Static or
 dynamic, I don't care. I've tried fucking everything and I can't get the
 dang thing to work. Static was a total no-go. With dynamic, using implib 
 I
 got it to link, but calling any of it resulted in an Access Violation. 
 Using
 coffimplib, best I could do had one linker error, a missing
 "_mysql_real_connect". This was all with "Connector/C" v6.0.2. I'd have
 tried an older version, 5.x, but 6.0.2 is the only version that seems to
 still exist.

I have no experience with D on windows, have you tried using unilink though? I seem to recall that can link COFF and OMF together?

Sort of...I'm having a hell of a time figuring unilink out. No matter what I do it keeps giving me: UniLink v1.07 [beta] (build 3.17) Invalid config file
Jul 22 2011
parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On 22.07.2011 23:06, Nick Sabalausky wrote:
 "Robert Clipsham"<robert octarineparrot.com>  wrote in message
 news:j0ce0t$2rte$1 digitalmars.com...
 On 22/07/2011 07:20, Nick Sabalausky wrote:
 Anyone have a known-working Windows OMF library for MySQL? Static or
 dynamic, I don't care. I've tried fucking everything and I can't get the
 dang thing to work. Static was a total no-go. With dynamic, using implib
 I
 got it to link, but calling any of it resulted in an Access Violation.
 Using
 coffimplib, best I could do had one linker error, a missing
 "_mysql_real_connect". This was all with "Connector/C" v6.0.2. I'd have
 tried an older version, 5.x, but 6.0.2 is the only version that seems to
 still exist.

though? I seem to recall that can link COFF and OMF together?

do it keeps giving me: UniLink v1.07 [beta] (build 3.17) Invalid config file

a config in it's home directory called ulink.cfg (a-la dmd btw) for all of it's linking. It contains default libraries, paths, flags, etc. Problem is by default it has *wrong* config that blows up at start so that people won't forget to configure things before getting hard to trace problems (e.g. certain cases of linking very different RTLs into unpredicatble mess). Here is the config I use, it should get you going (things after ; are commented out): # Change and uncoment any of next strings if needed -r -O # remap import names, bind image ; -Gw # D6/BCB6 dfm-style ; -Ge # disable library exports ; -w-cmt # disable compatibility messages ; -o -Gh # Import by ordinal, strip unused PE headers -LC:\DMD2\Windows\LIB -zkernel32;advapi32;user32;wsock32;shell32;snn;phobos -Go -- Dmitry Olshansky
Jul 22 2011
parent "Nick Sabalausky" <a a.a> writes:
"Dmitry Olshansky" <dmitry.olsh gmail.com> wrote in message 
news:j0cj58$5i5$1 digitalmars.com...
 On 22.07.2011 23:06, Nick Sabalausky wrote:
 "Robert Clipsham"<robert octarineparrot.com>  wrote in message
 news:j0ce0t$2rte$1 digitalmars.com...
 On 22/07/2011 07:20, Nick Sabalausky wrote:
 Anyone have a known-working Windows OMF library for MySQL? Static or
 dynamic, I don't care. I've tried fucking everything and I can't get 
 the
 dang thing to work. Static was a total no-go. With dynamic, using 
 implib
 I
 got it to link, but calling any of it resulted in an Access Violation.
 Using
 coffimplib, best I could do had one linker error, a missing
 "_mysql_real_connect". This was all with "Connector/C" v6.0.2. I'd have
 tried an older version, 5.x, but 6.0.2 is the only version that seems 
 to
 still exist.

though? I seem to recall that can link COFF and OMF together?

what I do it keeps giving me: UniLink v1.07 [beta] (build 3.17) Invalid config file

config in it's home directory called ulink.cfg (a-la dmd btw) for all of it's linking. It contains default libraries, paths, flags, etc. Problem is by default it has *wrong* config that blows up at start so that people won't forget to configure things before getting hard to trace problems (e.g. certain cases of linking very different RTLs into unpredicatble mess). Here is the config I use, it should get you going (things after ; are commented out): # Change and uncoment any of next strings if needed -r -O # remap import names, bind image ; -Gw # D6/BCB6 dfm-style ; -Ge # disable library exports ; -w-cmt # disable compatibility messages ; -o -Gh # Import by ordinal, strip unused PE headers -LC:\DMD2\Windows\LIB -zkernel32;advapi32;user32;wsock32;shell32;snn;phobos -Go

Hmm, I had just replaced the default ulink.cfg with the content of ulink.dm (and adusted the path for -L), so I was missing -r and -O...But it looks like the main problem is that I'd been working on it for too long and too damn late at night, so I forgot to surround -L{path with spaces} in double quotes. I'm getting Unilinks's Syntax screen now...We'll see how it goes from here...
Jul 22 2011
prev sibling next sibling parent Don <nospam nospam.com> writes:
Nick Sabalausky wrote:
 Anyone have a known-working Windows OMF library for MySQL? Static or 
 dynamic, I don't care. I've tried fucking everything and I can't get the 
 dang thing to work. Static was a total no-go. With dynamic, using implib I 
 got it to link, but calling any of it resulted in an Access Violation. Using 
 coffimplib, best I could do had one linker error, a missing 
 "_mysql_real_connect". This was all with "Connector/C" v6.0.2. I'd have 
 tried an older version, 5.x, but 6.0.2 is the only version that seems to 
 still exist.
 
 

Thunderbird died on me.
Jul 22 2011
prev sibling parent reply "Nick Sabalausky" <a a.a> writes:
"Nick Sabalausky" <a a.a> wrote in message 
news:j0b4r1$icb$1 digitalmars.com...
 Anyone have a known-working Windows OMF library for MySQL? Static or 
 dynamic, I don't care. I've tried fucking everything and I can't get the 
 dang thing to work. Static was a total no-go. With dynamic, using implib I 
 got it to link, but calling any of it resulted in an Access Violation. 
 Using coffimplib, best I could do had one linker error, a missing 
 "_mysql_real_connect". This was all with "Connector/C" v6.0.2. I'd have 
 tried an older version, 5.x, but 6.0.2 is the only version that seems to 
 still exist.

Goddamnnit, I think the whole problem was that stupid linking with a C "long" issue... The function mysql_real_connect takes a long, and it's the only part of the MySQL interface being used that takes a long. No idea why it still worked on Linux, but fingers crossed that a DDMD-style C bridge will fix it...
Jul 22 2011
next sibling parent "Nick Sabalausky" <a a.a> writes:
"Nick Sabalausky" <a a.a> wrote in message 
news:j0dqhg$2cvs$1 digitalmars.com...
 "Nick Sabalausky" <a a.a> wrote in message 
 news:j0b4r1$icb$1 digitalmars.com...
 Anyone have a known-working Windows OMF library for MySQL? Static or 
 dynamic, I don't care. I've tried fucking everything and I can't get the 
 dang thing to work. Static was a total no-go. With dynamic, using implib 
 I got it to link, but calling any of it resulted in an Access Violation. 
 Using coffimplib, best I could do had one linker error, a missing 
 "_mysql_real_connect". This was all with "Connector/C" v6.0.2. I'd have 
 tried an older version, 5.x, but 6.0.2 is the only version that seems to 
 still exist.

Goddamnnit, I think the whole problem was that stupid linking with a C "long" issue... The function mysql_real_connect takes a long, and it's the only part of the MySQL interface being used that takes a long. No idea why it still worked on Linux, but fingers crossed that a DDMD-style C bridge will fix it...

Ok, yea, it was a C long issue with the bindings, although I ended up not needing a C bridge. Apparently, C's "int" and "long" are both 32-bit on a 32-bit system (Also apparent: it's been a very long time since I used C/C++...) Screwy C... Once I changed the "ulong" param in the D binding for mysql_real_connect to "uint", the instructions at ( http://www.wikiservice.at/d/wiki.cgi?DatabaseBindings#MySQL ) suddenly worked like a charm. I'm now connected to my MySQL DB from D. Whoohoo! I still have no idea why it seemed to work fine on Linux without that change, but at the moment I don't particularly give a crap...
Jul 23 2011
prev sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
This is what you should use for C long and unsigned long:

import core.stdc.config;
c_long;
c_ulong;
Jul 23 2011