(coff)-Implib lib from dll

%u nrgyzer at gmail.com
Sat Jan 15 08:07:24 PST 2011

Hey guys,

I'm trying to connect to my mysql-server on windows. I'm using the mysql binding from http://www.steinmole.de/d/ because as I know the
DDBI project doesn't support D2.
I followed the instructions on the site and first created the lib file with implib with the following command: "implib libmysql.lib
libmysql.dll" (without ").
Next, I changed the extern(C) statement in mysql.d to extern(Windows).

Now... I create a simple application with the following source:

module test;

pragma(lib, "libmysql.lib");

import mysql;

int main(string[] args) {

	MYSQL* mysql;
	mysql = mysql_init(null);

	return 0;


I'm trying to compile the source file by using the following command:
"dmd -d test.d mysql.d" (without quotas). The result is the following:

 Error 42: Symbol Undefined _mysql_init at 4
 Error 42: Symbol Undefined _mysql_close at 4
--- errorlevel 2

I also tried "dmd -d test.d mysql.d libmysql.lib" without any success. When I remove the extern-statement from mysql.d, I get similar

Note... I'm using the github-version 0.2.3 which was released last week.

I think my mistake is the linking because the binding works on Linux. But... not on Windows - perhaps... anyone know how what I'm doing


More information about the Digitalmars-d-learn mailing list