Jump to page: 1 2
Thread overview
MySQL
Jan 21, 2012
Mars
Jan 21, 2012
DNewbie
Jan 22, 2012
Mars
Jan 22, 2012
Ali Çehreli
Jan 22, 2012
Mars
Jan 22, 2012
Ali Çehreli
Jan 22, 2012
DNewbie
Jan 22, 2012
Mars
Jan 22, 2012
DNewbie
Jan 22, 2012
Mars
Jan 22, 2012
Jesse Phillips
Jan 22, 2012
Kapps
Jan 23, 2012
Mars
Jan 24, 2012
Mike Parker
January 21, 2012
Hello everyone.
I've been trying to use MySQL in an application on Windows, but I always get
> Symbol Undefined _mysql_init
I've put the lib in the correct folder, so I don't know what the problem might be. I've tried several libs, and tried to compile it myself (always converted using coffimplib), but it fails, no matter what. I've also tried to make a def file out of the lib, and the functions are definitly listed as exports there.
Any idea what I might doing wrong?

Mars
January 21, 2012
Please check whether your MySQL lib is 64 bit and your app is 32 bit.


On Sat, Jan 21, 2012, at 10:38 PM, Mars wrote:
> Hello everyone.
> I've been trying to use MySQL in an application on Windows, but I
> always get
> > Symbol Undefined _mysql_init
> I've put the lib in the correct folder, so I don't know what the
> problem might be. I've tried several libs, and tried to compile
> it myself (always converted using coffimplib), but it fails, no
> matter what. I've also tried to make a def file out of the lib,
> and the functions are definitly listed as exports there.
> Any idea what I might doing wrong?
> 
> Mars
> 


-- 

  D
January 22, 2012
On Saturday, 21 January 2012 at 23:44:12 UTC, DNewbie wrote:
> Please check whether your MySQL lib is 64 bit and your app is 32 bit.

The lib is 32 bit, just like my application.
January 22, 2012
On 01/21/2012 01:38 PM, Mars wrote:
> Hello everyone.
> I've been trying to use MySQL in an application on Windows, but I always
> get
>> Symbol Undefined _mysql_init
> I've put the lib in the correct folder, so I don't know what the problem
> might be. I've tried several libs, and tried to compile it myself
> (always converted using coffimplib), but it fails, no matter what. I've
> also tried to make a def file out of the lib, and the functions are
> definitly listed as exports there.
> Any idea what I might doing wrong?
>
> Mars

Are you also including the library on the command line with -L-l? For example, for ncurses:

  dmd ... -L-lncurses ...

And if needed, also -L-L to specify the location of library files for the linker.

Ali
January 22, 2012
On Sunday, 22 January 2012 at 00:50:28 UTC, Ali Çehreli wrote:
> Are you also including the library on the command line with -L-l? For example, for ncurses:
>
>  dmd ... -L-lncurses ...
>
> And if needed, also -L-L to specify the location of library files for the linker.
>
> Ali

Yes, I am including it. Tried pragma and command line. And I don't get a message that the lib couldn't be found.
What exactly is -L-l supposed to do? Is this valid in DMD 2.057? I get an error with it (Unknown Option).

Mars
January 22, 2012
On 01/21/2012 06:28 PM, Mars wrote:
> On Sunday, 22 January 2012 at 00:50:28 UTC, Ali Çehreli wrote:
>> Are you also including the library on the command line with -L-l? For
>> example, for ncurses:
>>
>> dmd ... -L-lncurses ...
>>
>> And if needed, also -L-L to specify the location of library files for
>> the linker.
>>
>> Ali
>
> Yes, I am including it. Tried pragma and command line. And I don't get a
> message that the lib couldn't be found.
> What exactly is -L-l supposed to do? Is this valid in DMD 2.057? I get
> an error with it (Unknown Option).
>
> Mars

-L is dmd's the linker flag option. Anything after that is passed to the linker. So -L-l passes -l to the linker:

  http://www.d-programming-language.org/dmd-linux.html

Ali
January 22, 2012

On Sun, Jan 22, 2012, at 12:11 AM, Ali Çehreli wrote:
> On 01/21/2012 06:28 PM, Mars wrote:
> > On Sunday, 22 January 2012 at 00:50:28 UTC, Ali Çehreli wrote:
> >> Are you also including the library on the command line with -L-l? For example, for ncurses:
> >>
> >> dmd ... -L-lncurses ...
> >>
> >> And if needed, also -L-L to specify the location of library files for the linker.
> >>
> >> Ali
> >
> > Yes, I am including it. Tried pragma and command line. And I don't get a
> > message that the lib couldn't be found.
> > What exactly is -L-l supposed to do? Is this valid in DMD 2.057? I get
> > an error with it (Unknown Option).
> >
> > Mars
> 
> -L is dmd's the linker flag option. Anything after that is passed to the linker. So -L-l passes -l to the linker:
> 
>    http://www.d-programming-language.org/dmd-linux.html
> 
> Ali
> 


I've took a look at MySQL headers, the functions use __stdcall, but in libmysql.dll exports table they are not decorated.

January 22, 2012
On Sunday, 22 January 2012 at 08:11:21 UTC, Ali Çehreli wrote:
> -L is dmd's the linker flag option. Anything after that is passed to the linker. So -L-l passes -l to the linker:
>
>  http://www.d-programming-language.org/dmd-linux.html
>
> Ali

Let me rephrase that, is this valid for OPTLINK?
>Unknown Option : LLIBMYSQL
Normally I just include the lib files in the files list (dmd foo.d bar.lib).

Mars
January 22, 2012
On Sunday, 22 January 2012 at 10:21:29 UTC, DNewbie wrote:
> I've took a look at MySQL headers, the functions use   stdcall, but in libmysql.dll exports table they are not decorated.

This means...?
Shouldn't it at least compile, if they are listed in the def file, coming from the lib?
January 22, 2012
On Sunday, 22 January 2012 at 12:11:58 UTC, Mars wrote:
> Let me rephrase that, is this valid for OPTLINK?
>>Unknown Option : LLIBMYSQL
> Normally I just include the lib files in the files list (dmd foo.d bar.lib).
>
> Mars

No, in fact I couldn't find how to pass a library search path to optlink. It can be added to the sc.ini file, but I couldn't find a command line option. -l is an ld flag.
« First   ‹ Prev
1 2