/usr/bin/ld: [...] undefined reference to _D3std6format6internal6write...

Paul Backus snarwin at gmail.com
Tue Dec 20 20:55:08 UTC 2022


On Tuesday, 20 December 2022 at 20:01:04 UTC, Anonymouse wrote:
> What does `-allinst` even do

`-allinst` tells the compiler to generate code for all 
instantiated templates, even if it thinks that code has already 
been generated in a different object file.

Why would the compiler think that? Sometimes, which templates get 
instantiated can depend on which flags the code is compiled with. 
If you compile your code with one set of flags, and link it 
against a library compiled with a different set of flags, then 
the different invocations of the compiler may disagree on which 
templates should end up in which object files.

> and why does it seem to be insufficient here?

Hard to say without more information. Are you compiling with 
`-preview=dip1000`? If not, does adding that flag fix the error?


More information about the Digitalmars-d-learn mailing list