MySQL

Kapps Kapps at NotValidEmail.com
Sun Jan 22 15:23:22 PST 2012


The way I did it is
1) Download C connector from mysql's website, 6.0.2 is version headers 
were made for. Remember you'll need the 32-bit one if you're using DMD 
on Windows.
2) Create the binding functions using extern(System).
3) For Windows, use 'coffimplib libmysql.dll libmysql.lib', and build 
with "PathToFile/libmysql.lib". Example: 'dmd test.d libmysql.lib'
3b) For Linux, just link to libmysqlclient. a with -L"libmysqlclient.a" 
or by just passing path.
4) Make sure that libmysql.dll (for Windows) is in the application 
folder otherwise you'll get errors when trying to run.

On 21/01/2012 3: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



More information about the Digitalmars-d-learn mailing list