Undefined _D10TypeInfo_l6__initZ and _D15TypeInfo_Struct6__vtblZ added when instantiating template structs

Laeeth Isharc via D.gnu d.gnu at puremagic.com
Mon Jan 26 13:52:33 PST 2015


On Monday, 26 January 2015 at 17:50:59 UTC, Liran Zvibel wrote:
> Hi,
>
> I would like to use some D code in a C binary
> .
> Part of the D functionality used is by instantiating templated 
> structs.
>
> Even if I just try to compile the following simple code:
>
> extern (C) {
>     alias mytpye = BLA!(int);
>     struct BLA(T) {
>         T x;
>     }
> }
>
> With the following gcd flags:
> -fno-invariants -fno-in -fno-out -fno-bounds-check -O3 
> -fno-assert -c -nophoboslib  -nostdlib
>
> I still have 3 undefined symbols:
> _D10TypeInfo_i6__initZ _D15TypeInfo_Struct6__vtblZ _Dmodule_ref
>
> I can alway just define them in the C glue code and get it over 
> with, but I would like to understand what I SHOULD do to get it 
> to easily link into a normal C executable.
>
> Thanks!
> Liran


Is the BLA struct instantiated somewhere?


More information about the D.gnu mailing list