Thread overview
undefined symbol: _D3std7variant...
Oct 22, 2019
Andrey
Oct 22, 2019
Daniel Kozak
Oct 22, 2019
Andrey
Oct 23, 2019
baz
Oct 23, 2019
Johan
October 22, 2019
Hello,
During compilation on linking stage I get strange errors (LDC):
lld-link: error: undefined symbol: _D3std7variant__T8VariantNVmi56TSQBf8typecons__T5TupleTAyuTSQCgQCf__TQCaVmi32TSQCzQBu__TQBoTAQBmTQBqZQCbTQnTQCbZQDrZQCqTQBcTQCrZQEh4typeMxFNbNdNeZC8TypeInfo
>>> referenced by E:\Programs\LDC2\import\std\variant.d:753
>>>               .dub\obj\builder.obj:(_D3std7variant__T8VariantNVmi56TSQBf8typecons__T5TupleTAyuTSQCgQCf__TQCaVmi32TSQCzQBu__TQBoTAQBmTQBqZQCbTQnTQCbZQDrZQCqTQBcTQCrZQEh__T4peekTQDhZQkMNgFNdZPNgAyu)                       referenced by E:\Programs\LDC2\import\std\variant.d:753
>>>               .dub\obj\builder.obj:(_D3std7variant__T8VariantNVmi56TSQBf8typecons__T5TupleTAyuTSQCgQCf__TQCaVmi32TSQCzQBu__TQBoTAQBmTQBqZQCbTQnTQCbZQDrZQCqTQBcTQCrZQEh__T4peekTQBwZQkMNgFNdZPNgAAyu)                      referenced by E:\Programs\LDC2\import\std\variant.d:820
>>>               .dub\obj\builder.obj:(_D3std7variant__T8VariantNVmi56TSQBf8typecons__T5TupleTAyuTSQCgQCf__TQCaVmi32TSQCzQBu__TQBoTAQBmTQBqZQCbTQnTQCbZQDrZQCqTQBcTQCrZQEh__T3getTQEdZQjMNgFNdZNgSQFxQEs__TQEmTQEjTQEjZQEy)

How to solve?
This is the first time when linking fails on Phobos library.
October 22, 2019
On Tue, Oct 22, 2019 at 2:20 PM Andrey via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote:
>
> Hello,
> During compilation on linking stage I get strange errors (LDC):
> lld-link: error: undefined symbol:
> _D3std7variant__T8VariantNVmi56TSQBf8typecons__T5TupleTAyuTSQCgQCf__TQCaVmi32TSQCzQBu__TQBoTAQBmTQBqZQCbTQnTQCbZQDrZQCqTQBcTQCrZQEh4typeMxFNbNdNeZC8TypeInfo
> >>> referenced by E:\Programs\LDC2\import\std\variant.d:753
> >>>
> >>> .dub\obj\builder.obj:(_D3std7variant__T8VariantNVmi56TSQBf8typecons__T5TupleTAyuTSQCgQCf__TQCaVmi32TSQCzQBu__TQBoTAQBmTQBqZQCbTQnTQCbZQDrZQCqTQBcTQCrZQEh__T4peekTQDhZQkMNgFNdZPNgAyu)                       referenced by E:\Programs\LDC2\import\std\variant.d:753
> >>>
> >>> .dub\obj\builder.obj:(_D3std7variant__T8VariantNVmi56TSQBf8typecons__T5TupleTAyuTSQCgQCf__TQCaVmi32TSQCzQBu__TQBoTAQBmTQBqZQCbTQnTQCbZQDrZQCqTQBcTQCrZQEh__T4peekTQBwZQkMNgFNdZPNgAAyu)                      referenced by E:\Programs\LDC2\import\std\variant.d:820
> >>>
> >>> .dub\obj\builder.obj:(_D3std7variant__T8VariantNVmi56TSQBf8typecons__T5TupleTAyuTSQCgQCf__TQCaVmi32TSQCzQBu__TQBoTAQBmTQBqZQCbTQnTQCbZQDrZQCqTQBcTQCrZQEh__T3getTQEdZQjMNgFNdZNgSQFxQEs__TQEmTQEjTQEjZQEy)
>
> How to solve?
> This is the first time when linking fails on Phobos library.

Have you try to clean all caches? Try to remove .dub folder

October 22, 2019
On Tuesday, 22 October 2019 at 12:57:45 UTC, Daniel Kozak wrote:
> Have you try to clean all caches? Try to remove .dub folder

I removed .dub folder but this error appears again.
October 23, 2019
On Tuesday, 22 October 2019 at 13:07:54 UTC, Andrey wrote:
> On Tuesday, 22 October 2019 at 12:57:45 UTC, Daniel Kozak wrote:
>> Have you try to clean all caches? Try to remove .dub folder
>
> I removed .dub folder but this error appears again.

Try the "-allinst" option. It's possibly a bug with speculative template instantiation.
"-allinst" deactivates speculation and everything is always instantiated and therefore present in the object files.
October 23, 2019
On Wednesday, 23 October 2019 at 20:45:55 UTC, baz wrote:
> On Tuesday, 22 October 2019 at 13:07:54 UTC, Andrey wrote:
>> On Tuesday, 22 October 2019 at 12:57:45 UTC, Daniel Kozak wrote:
>>> Have you try to clean all caches? Try to remove .dub folder
>>
>> I removed .dub folder but this error appears again.
>
> Try the "-allinst" option. It's possibly a bug with speculative template instantiation.
> "-allinst" deactivates speculation and everything is always instantiated and therefore present in the object files.

If `-allinst` works, then please minimize the testcase and put it in our bugtracker. We know there are template culling problems but it only appears in very complex code. I have not been able to reduce it to less than a < 20k line problem across a ton of files...

-Johan