Re: AutoDLL

2017-07-06 Thread FoxyBrown via Digitalmars-d-learn
Here is a solution that will wrap all extern C functions and allow one to then map them to a dll. auto BuildDLLClassFromCHeader(alias modulename, string name)() { import std.traits, std.algorithm, std.meta; auto s = "extern (C) class " ~name~"\n{\n\timport ___import = "~moduleName!mod

Re: AutoDLL

2017-07-06 Thread FoxyBrown via Digitalmars-d-learn
On Thursday, 6 July 2017 at 16:14:18 UTC, Mike Parker wrote: On Thursday, 6 July 2017 at 12:15:57 UTC, FoxyBrown wrote: //pragma(lib, "portaudio_x86.lib"); // Doesn't work because libs are invalid Probably just a OMF/COFF issue. If you try to link with a COFF library while compiling with 3

Re: AutoDLL

2017-07-06 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 6 July 2017 at 16:14:18 UTC, Mike Parker wrote: to compile with -m32mscoff MS linker instead. Either that, or *to use* the MS linker

Re: AutoDLL

2017-07-06 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 6 July 2017 at 12:15:57 UTC, FoxyBrown wrote: //pragma(lib, "portaudio_x86.lib"); // Doesn't work because libs are invalid Probably just a OMF/COFF issue. If you try to link with a COFF library while compiling with 32-bit DMD in its default configuration on Windows, you'll get

AutoDLL

2017-07-06 Thread FoxyBrown via Digitalmars-d-learn
A DLL Loader prototype that loads DLL's, just specify the declaration. Probably should be worked up so it is easy to load DLL's. Example: import portaudio; import std.conv, std.stdio; import core.stdc.stdio; //pragma(lib, "portaudio_x86.lib"); // Doesn't work because libs are invalid