Elegant way to use dynamic bindings

Mike Wey mike-wey at example.com
Fri Feb 9 18:14:06 UTC 2018


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 
>> error suggests you didn't.
> 
> I added `pragma(lib, "mupen64plus.lib");` above the extern(C) block.
> Adding `libs "mupen64plus"` to dub.sdl doesn't make a difference.
> 
> The thing that confuses me is that the import lib has symbols without 
> underscore prefix (I see them when running `libunres -p 
> mupen64plus.lib`), but when I change the function pointer declaration 
> into a function declaration it tries to link "_CoreGetAPIVersions" and 
> can't find it.
> 
> I put the .dll's in the root of the project directory by the way. Does 
> that count as a "system library search path"?

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.

-- 
Mike Wey


More information about the Digitalmars-d-learn mailing list