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

Anonymouse zorael at gmail.com
Tue Dec 20 20:01:04 UTC 2022


I'm trying to build my thing with gdc. It (now) compiles, but 
fails to link on this Manjaro/Arch laptop with gdc 12.2.0.

```
/usr/bin/ld: /tmp/ccstWTAS.o: in function 
`_D3std6format8internal5write__T8getWidthTAyaZQoFNaNfQlZl':
/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include/d/std/format/internal/write.d:3819: undefined reference to `_D3std9algorithm9searching__T3allSQBg6format8internal5write__T8getWidthTAyaZQoFQhZ9__lambda2Z__TQCpTQBcZQCxMFNaNfQBpZb'
/usr/bin/ld: /tmp/ccstWTAS.o: in function 
`_D3std6format8internal5write__T8getWidthTAaZQnFNaNfQkZl':
/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/include/d/std/format/internal/write.d:3819: undefined reference to `_D3std9algorithm9searching__T3allSQBg6format8internal5write__T8getWidthTAaZQnFQgZ9__lambda2Z__TQCoTQBbZQCwMFNaNfQBoZb'
[...]
```

A few lines like those covering half a screen, all of it of 
phobos.

What conventional wisdom I've picked up somewhere along the way 
says to use `-allinst` in cases like these, and after asking 
around on the Discord and finding out about gdc's equivalent 
`-fall-instantiations`, it now links on a different Ubuntu 
machine with gdc 12.1.0. No luck still with the laptop and its 
12.2.0, although the linker outputs fewer errors now.

What does `-allinst` even do and why does it seem to be 
insufficient here?


More information about the Digitalmars-d-learn mailing list