digitalmars.D.learn - Using MinGW DLL with DMD?
- Jacob Carlborg (3/3) Aug 09 2012 Is it possible to link a DLL compiled for MinGW with DMD?
- Adam D. Ruppe (7/8) Aug 09 2012 Yeah, I've use dlls made in gcc with dmd. You need to run implib
- Dejan Lekic (4/13) Aug 09 2012 Yes, this works in most cases, but when it does not, then you
- Jacob Carlborg (4/10) Aug 09 2012 Thanks, I'll give it a try.
- Dejan Lekic (13/14) Aug 09 2012 Yes, it is possible.
- dnewbie (2/2) Aug 09 2012 There's an example:
Is it possible to link a DLL compiled for MinGW with DMD? -- /Jacob Carlborg
Aug 09 2012
On Thursday, 9 August 2012 at 13:43:18 UTC, Jacob Carlborg wrote:Is it possible to link a DLL compiled for MinGW with DMD?Yeah, I've use dlls made in gcc with dmd. You need to run implib over the dll to get a .lib and then it works pretty easily. implib /s mydll.lib mydll.dll implib can be found in the basic utilities package at digital mars. http://www.digitalmars.com/download/freecompiler.html
Aug 09 2012
On Thursday, 9 August 2012 at 13:48:14 UTC, Adam D. Ruppe wrote:On Thursday, 9 August 2012 at 13:43:18 UTC, Jacob Carlborg wrote:Yes, this works in most cases, but when it does not, then you have to use DEF files and modify/add symbols. It is not complicated, just time-consuming...Is it possible to link a DLL compiled for MinGW with DMD?Yeah, I've use dlls made in gcc with dmd. You need to run implib over the dll to get a .lib and then it works pretty easily. implib /s mydll.lib mydll.dll implib can be found in the basic utilities package at digital mars. http://www.digitalmars.com/download/freecompiler.html
Aug 09 2012
On 2012-08-09 15:48, Adam D. Ruppe wrote:Yeah, I've use dlls made in gcc with dmd. You need to run implib over the dll to get a .lib and then it works pretty easily. implib /s mydll.lib mydll.dll implib can be found in the basic utilities package at digital mars. http://www.digitalmars.com/download/freecompiler.htmlThanks, I'll give it a try. -- /Jacob Carlborg
Aug 09 2012
On Thursday, 9 August 2012 at 13:43:18 UTC, Jacob Carlborg wrote:Is it possible to link a DLL compiled for MinGW with DMD?Yes, it is possible. Long ago i have dealt with this almost on a daily basis (we used Borland C++ Builder on Windows in the former company I worked for). The easiest method is to use DEF files to create the import library. If you do not have it, you can use some tool that will analyse the DLL, make the DEF file for you, and then you modify it to your needs, and then create the import library for your target toolchain. This article explains everything you need to know: http://wyw.dcweb.cn/stdcall.htm Regards
Aug 09 2012
There's an example: http://my.opera.com/run3/blog/2012/01/24/mixing-c-and-d-on-windows-part-1
Aug 09 2012