[Issue 22323] Link error for virtual destructor of C++ class in DLL

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 20 03:24:30 UTC 2021


kinke <kinke at gmx.net> changed:

           What    |Removed                     |Added
                 CC|                            |kinke at gmx.net

--- Comment #1 from kinke <kinke at gmx.net> ---
(In reply to Tim from comment #0)
> It works using static linking.

Then it looks like the MS compiler generates the symbol but doesn't export it
even when exporting the class - or at least doesn't include the forwarder in
the DLL import lib.

It looks like this might be solvable by removing the condition in
where the D compiler only defines it in case the regular destructor is defined
in D as well. The symbol would most likely need to be emitted as a weak
definition though to prevent conflicts when linking statically etc.


More information about the Digitalmars-d-bugs mailing list