Thread overview
Link error (issue 23209)
January 08

https://issues.dlang.org/show_bug.cgi?id=23209

This valid code:

void main()
{
    import std.net.curl, std.stdio;

    auto http = HTTP();
    http.setAuthentication("", "");
    writeln(1.0);
}

gives you this link error:
druntime/import/core/internal/switch_.d:189: error: undefined reference to '_D4core9exception__T15__switch_errorTZQsFNaNbNiNeAyamZv'

Demangled, the missing symbol is

pure nothrow @nogc @trusted void core.exception.__switch_errorT!().__switch_errorT(immutable(char)[], ulong)

So it seems to me that a template fails to instantiate. Can I force an explicit instantiation to work around this? How?

Thanks,
--Bastiaan.

January 08
On 08/01/2024 11:39 PM, Bastiaan Veelo wrote:
> So it seems to me that a template fails to instantiate. Can I force an explicit instantiation to work around this? How?

Did you try ``-allinst``?
January 08
On Monday, 8 January 2024 at 10:41:11 UTC, Richard (Rikki) Andrew Cattermole wrote:
> On 08/01/2024 11:39 PM, Bastiaan Veelo wrote:
>> So it seems to me that a template fails to instantiate. Can I force an explicit instantiation to work around this? How?
>
> Did you try ``-allinst``?

Thanks, that does it!

--Bastiaan.