why do i need an extern(C): here?
nise at nise.com
Thu Oct 15 21:47:16 UTC 2020
On Thursday, 15 October 2020 at 21:29:59 UTC, WhatMeWorry wrote:
> I've go a small DLL and a test module both written in D. Why do
> I need to use the extern(C)? Shouldn't both sides be using D
> name wrangling?
You have answered your own question. If you're not using
extern(C), D just like C++ adds a lot of name mangling which is
not "addSeven" but extra characters as well. GetProcAddress which
is a Windows call has no idea about D name mangling and therefore
will not find the function.
More information about the Digitalmars-d-learn