extern(C++): Unresolved scalar deleting destructor

Vladimir Marchevsky vladimmi at gmail.com
Tue Jul 24 16:41:37 UTC 2018


On Tuesday, 24 July 2018 at 16:30:41 UTC, Stefan Koch wrote:
> Seems like it's virtual destructor could that be?
>
> this qt5 binding: 
> https://github.com/MGWL/QtE5/blob/master/source/qte5.d
> seems to always define the constructor.

No, simple virtual (or final) destructor binds just fine with 
"~this()" or "final ~this()". "Scalar deleting destructor" is 
special thing, afaik, and my C++ knowledge is not enough to 
determine why is it required by D side and not required in C++ or 
not available in compiled lib.

QtE5, DQml or similar projects mostly wrap cpp-objects - create 
them on cpp side with helper function, save returned pointer on d 
side and operate via wrapper-functions that call methods on cpp 
side. But it looks I should be mostly able to interact with 
cpp-defined classes directly now, from 2.081 patchnotes:

"This release also includes ABI fixes where destructors are now 
correctly added to the virtual table, and constructor/destructor 
calling semantics now match C++. With this, mixed-language class 
hierarchies are working, with construction/destruction being 
supported in either language."


More information about the Digitalmars-d-learn mailing list