Mixing D and C - Windows
DNewbie
run3 at myopera.com
Mon Jan 2 17:02:59 PST 2012
Thank you both.
I've created a D DLL [http://dlang.org/dll.html], then I've loaded it from a C program [compiled with dmc].
However, I'd want to be able to call it from a C program compiled with MSVC, and I got a link error - unresolved external symbol [link testdll.obj /implib:mydll.lib /out:testdll-msvc.exe]. The LoadLibrary works with both DMC/MSVC, but it isn't 'handy'.?.
On Sat, Dec 31, 2011, at 07:20 PM, Exec wrote:
> Jakob Ovrum Wrote:
> > As for loading C symbols in a DLL from a D program, you must link
> > against an import library of the DLL, and create an interface
> > module (similar to a header file) with the C declarations.
> Alternatively, you can load the DLL via the Windows API.
> http://msdn.microsoft.com/en-us/library/windows/desktop/ms684175%28v=vs.85%29.aspx
>
--
D
More information about the Digitalmars-d-learn
mailing list