Can you create a library with LDC and link to it with clang++?
turkeyman at gmail.com
Thu Sep 24 08:02:02 UTC 2020
Remember that if you're linking with Clang, it won't automatically link the
druntime library because it assumes it's linking a C++ program. Make sure
you add the D libraries to your link command if you intend to use the D
Also, if your main function is in C++ like you show, then you need to init
and term the D runtime library:
https://dlang.org/phobos/rt_dmain2.html#.rt_init ... Call those those at
the start/end of your main function since C++'s startup/main won't do it
On Thu, Sep 24, 2020 at 10:30 AM Ruby The Roobster via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:
> On Wednesday, 23 September 2020 at 23:45:38 UTC, Manu wrote:
> > Except, you should use `extern(C++)` in your D code, and no
> > need to extern in your C++ code.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Digitalmars-d