www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Link error (issue 23209)

reply Bastiaan Veelo <Bastiaan Veelo.net> writes:
https://issues.dlang.org/show_bug.cgi?id=23209

This valid code:
```d
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
```d
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.
Jan 08
parent reply "Richard (Rikki) Andrew Cattermole" <richard cattermole.co.nz> writes:
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``?
Jan 08
parent Bastiaan Veelo <Bastiaan Veelo.net> writes:
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.
Jan 08