Thread overview
Need OMF MySQL lib that actually f^*&^ works...
Jul 22, 2011
Nick Sabalausky
Jul 22, 2011
Robert Clipsham
Jul 22, 2011
Nick Sabalausky
Jul 22, 2011
Dmitry Olshansky
Jul 22, 2011
Nick Sabalausky
Jul 22, 2011
Don
Jul 23, 2011
Nick Sabalausky
Jul 23, 2011
Nick Sabalausky
Jul 23, 2011
Andrej Mitrovic
July 22, 2011
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.


July 22, 2011
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/
July 22, 2011
"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


July 22, 2011
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.
>> 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
>
>
Uhm, let me try to sort this out for you, the thing is that unilink uses 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

July 22, 2011
"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.
>>> 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
>>
>>
> Uhm, let me try to sort this out for you, the thing is that unilink uses 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
>
>

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...



July 22, 2011
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 one that works (dates from 2009). I tried to attach it, but Thunderbird died on me.
July 23, 2011
"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...


July 23, 2011
"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...



July 23, 2011
This is what you should use for C long and unsigned long:

import core.stdc.config;
c_long;
c_ulong;