On Friday, 9 February 2018 at 20:19:33 UTC, Dennis wrote:
I'd still like to find a nice way to generate the boilerplate
code for dynamic loading, if I come up with something I'll post
it here.
So I ended up using an import library for a while, but I then
wanted to get the handle of the DLL, w
On Friday, 9 February 2018 at 18:14:06 UTC, Mike Wey wrote:
You may need to pass `/s` to implib so it will add the
underscore to the symbol in the import library. If it's
actually needed depends on what the dll uses.
That did it, now both dynamic loading and dynamic linking work.
:) Thanks bo
On 09-02-18 15:04, Dennis wrote:
I read the Derelict documentation a while ago, I didn't grasp all of it.
Reading it again, I can now make sense of it though. :)
On Friday, 9 February 2018 at 12:53:44 UTC, Mike Parker wrote:
Did you link with the library you created with implib? That linker
er
On Friday, 9 February 2018 at 14:51:30 UTC, Mike Parker wrote:
Where was the lib file located? Was it in the root project
directory? How are you compiling your project? What does your
directory tree look like?
(...)
That depends. Is that the directory where your executable is
written? Are you
On Friday, 9 February 2018 at 14:04:05 UTC, Dennis wrote:
I added `pragma(lib, "mupen64plus.lib");` above the extern(C)
block.
Adding `libs "mupen64plus"` to dub.sdl doesn't make a
difference.
Where was the lib file located? Was it in the root project
directory? How are you compiling your pr
I read the Derelict documentation a while ago, I didn't grasp all
of it. Reading it again, I can now make sense of it though. :)
On Friday, 9 February 2018 at 12:53:44 UTC, Mike Parker wrote:
Did you link with the library you created with implib? That
linker error suggests you didn't.
I added
On Friday, 9 February 2018 at 12:15:04 UTC, Dennis wrote:
I presume the .dll isn't loaded properly (if at all), but I
can't find a load function in the .lib and don't know how to
debug this. So I guess I'll just do it manually since that
works, but does anyone have some tips to make .dll bin
On Friday, 9 February 2018 at 12:15:04 UTC, Dennis wrote:
I found the IMPLIB tool
(http://www.digitalmars.com//ctg/implib.html) and made a .lib
for the .dll and at first I got:
Error 42: Symbol Undefined _CoreGetAPIVersions
Error: linker exited with status 1
Forgot to address this in the p
I want to bind to a .dll on Windows, so I looked at how Derelict
packages are doing it and found it does it like this:
```
extern(C) {
alias da_CoreGetAPIVersions = m64p_error
function(int*,int*,int*,int*);
...
}
__gshared {
da_CoreGetAPIVersions CoreGetAPIVersions;
...
}
protected o