MySQL connection strange behavior (again...)

Kapps opantm2+spam at gmail.com
Wed Feb 22 19:56:08 PST 2012


On Wednesday, 22 February 2012 at 21:18:32 UTC, miazo wrote:
> Problem solved. :-)
>
> I found that it was @4 suffix that was missing. With a 
> libmysql.def file as below:
>
> LIBRARY libmysql
> EXETYPE NT
> SUBSYSTEM WINDOWS
> EXPORTS
> 	_mysql_init at 4 = mysql_init
>
> I was able to generate working libmysql.lib file with implib 
> (with /system switch).
>
> That, with changing from extern (C) to extern (System), removed 
> the problematic issue.
>
> Thank you for all your hints!

You shouldn't have to manually create a .def file. Try using 
coffimplib (I think it's bundled with dmc?) instead of implib and 
use it on libmysql.lib (coffimplib libmysql.lib _libmysql.lib, 
back up the original libmysql.lib, replace the original with the 
generated _libmysql.lib, and then link to it). Then create your 
headers with extern(System). It seems that adding it manually 
into the .def file is working for you, but it's a lot more effort 
than needed.



More information about the Digitalmars-d-learn mailing list