Thread overview
obscure messages relating to linking and imports in 2.071.1
Oct 05, 2016
Laeeth Isharc
Oct 05, 2016
Basile B.
Oct 05, 2016
Basile B.
Oct 06, 2016
Laeeth Isharc
October 05, 2016
I noticed the problem before - previously it was my fault.

I had a circulator dependency where A imported B, B did a selective import of C and C imported A selectively.  That led to link problems with module constructors.

Here I noticed it in a different context.  Simple two-page main code imports dateparser from code.dlang.org.  dateparser uses emsi containers, which use std.experimental.allocator.

If I don't import std.experimental.allocator in main module (where it isn't actually used) I get the link errors below.  If I import it, it goes away.

Might be fixed in 2.071.2 - will upgrade when I can.

Not certain it's a bug and if it is whether it might be fixed, but if you think I should I will report.

I can't share code publicly, but I can share gist privately.

Laeeth.

Linking...
/usr/lib/libphobos2.a(gc_allocator_2c45_42b.o):(.bss+0x0): multiple definition of `_D3std12experimental9allocator12gc_allocator11GCAllocator6__initZ'
../../../../../../../../home/laeeth/.dub/packages/experimental_allocator-2.70.0-b1/libexperimental_allocator.a(gc_allocator_b2_42b.o):(.bss+0x0): first defined here
/usr/lib/libphobos2.a(gc_allocator_2c45_42b.o): In function `_D3std12experimental9allocator12gc_allocator11GCAllocator8allocateMOFNemZAv':
(.text._D3std12experimental9allocator12gc_allocator11GCAllocator8allocateMOFNemZAv+0x0): multiple definition of `_D3std12experimental9allocator12gc_allocator11GCAllocator8allocateMOFNemZAv'
../../../../../../../../home/laeeth/.dub/packages/experimental_allocator-2.70.0-b1/libexperimental_allocator.a(gc_allocator_b2_42b.o):../../../../../../../../home/laeeth/.dub/packages/experimental_allocator-2.70.0-b1/src/std/experimental/allocator/gc_allocator.d:(.text._D3std12experimental9allocator12gc_allocator11GCAllocator8allocateMOFNemZAv+0x0): first defined here
/usr/lib/libphobos2.a(gc_allocator_2c45_42b.o): In function `_D3std12experimental9allocator12gc_allocator11GCAllocator10reallocateMOFKAvmZb':
(.text._D3std12experimental9allocator12gc_allocator11GCAllocator10reallocateMOFKAvmZb+0x0): multiple definition of `_D3std12experimental9allocator12gc_allocator11GCAllocator10reallocateMOFKAvmZb'
../../../../../../../../home/laeeth/.dub/packages/experimental_allocator-2.70.0-b1/libexperimental_allocator.a(gc_allocator_b2_42b.o):../../../../../../../../home/laeeth/.dub/packages/experimental_allocator-2.70.0-b1/src/std/experimental/allocator/gc_allocator.d:(.text._D3std12experimental9allocator12gc_allocator11GCAllocator10reallocateMOFKAvmZb+0x0): first defined here
/usr/lib/libphobos2.a(gc_allocator_2c45_42b.o): In function `_D3std12experimental9allocator12gc_allocator11GCAllocator22resolveInternalPointerMOFPvZAv':
(.text._D3std12experimental9allocator12gc_allocator11GCAllocator22resolveInternalPointerMOFPvZAv+0x0): multiple definition of `_D3std12experimental9allocator12gc_allocator11GCAllocator22resolveInternalPointerMOFPvZAv'
../../../../../../../../home/laeeth/.dub/packages/experimental_allocator-2.70.0-b1/libexperimental_allocator.a(gc_allocator_b2_42b.o):../../../../../../../../home/laeeth/.dub/packages/experimental_allocator-2.70.0-b1/src/std/experimental/allocator/gc_allocator.d:(.text._D3std12experimental9allocator12gc_allocator11GCAllocator22resolveInternalPointerMOFPvZAv+0x0): first defined here
/usr/lib/libphobos2.a(gc_allocator_2c45_42b.o): In function `_D3std12experimental9allocator12gc_allocator11GCAllocator10deallocateMOFAvZb':
(.text._D3std12experimental9allocator12gc_allocator11GCAllocator10deallocateMOFAvZb+0x0): multiple definition of `_D3std12experimental9allocator12gc_allocator11GCAllocator10deallocateMOFAvZb'
../../../../../../../../home/laeeth/.dub/packages/experimental_allocator-2.70.0-b1/libexperimental_allocator.a(gc_allocator_b2_42b.o):../../../../../../../../home/laeeth/.dub/packages/experimental_allocator-2.70.0-b1/src/std/experimental/allocator/gc_allocator.d:(.text._D3std12experimental9allocator12gc_allocator11GCAllocator10deallocateMOFAvZb+0x0): first defined here
/usr/lib/libphobos2.a(gc_allocator_2c45_42b.o):(.bss+0x1): multiple definition of `_D3std12experimental9allocator12gc_allocator11GCAllocator8instanceOS3std12experimental9allocator12gc_allocator11GCAllocator'
../../../../../../../../home/laeeth/.dub/packages/experimental_allocator-2.70.0-b1/libexperimental_allocator.a(gc_allocator_b2_42b.o):(.bss+0x1): first defined here
/usr/lib/libphobos2.a(gc_allocator_2c45_42b.o): In function `_D3std12experimental9allocator12gc_allocator11GCAllocator7collectMOFNeZv':
(.text._D3std12experimental9allocator12gc_allocator11GCAllocator7collectMOFNeZv+0x0): multiple definition of `_D3std12experimental9allocator12gc_allocator11GCAllocator7collectMOFNeZv'
../../../../../../../../home/laeeth/.dub/packages/experimental_allocator-2.70.0-b1/libexperimental_allocator.a(gc_allocator_b2_42b.o):../../../../../../../../home/laeeth/.dub/packages/experimental_allocator-2.70.0-b1/src/std/experimental/allocator/gc_allocator.d:(.text._D3std12experimental9allocator12gc_allocator11GCAllocator7collectMOFNeZv+0x0): first defined here
collect2: error: ld returned 1 exit status
--- errorlevel 1
dmd failed with exit code 1.

October 05, 2016
On Wednesday, 5 October 2016 at 11:45:49 UTC, Laeeth Isharc wrote:
> I noticed the problem before - previously it was my fault.
>
> I had a circulator dependency where A imported B, B did a selective import of C and C imported A selectively.  That led to link problems with module constructors.
>
> [...]

It looks like there's a conflict between HackerPilot's fork and the phobos version.
But HackerPilot's fork is not used anymore. Have you pulled the latest versions recently (or dub upgrade if you use DUB) ?

(verification: https://github.com/economicmodeling/containers/commit/528cae2880c0e5faa57d192621ad0533b0124b7b)
October 05, 2016
On Wednesday, 5 October 2016 at 12:12:24 UTC, Basile B. wrote:
> On Wednesday, 5 October 2016 at 11:45:49 UTC, Laeeth Isharc wrote:
>> I noticed the problem before - previously it was my fault.
>>
>> I had a circulator dependency where A imported B, B did a selective import of C and C imported A selectively.  That led to link problems with module constructors.
>>
>> [...]
>
> It looks like there's a conflict between HackerPilot's fork and the phobos version.
> But HackerPilot's fork is not used anymore. Have you pulled the latest versions recently (or dub upgrade if you use DUB) ?
>
> (verification: https://github.com/economicmodeling/containers/commit/528cae2880c0e5faa57d192621ad0533b0124b7b)

Forgot to say but let's say you're not using DUB but rather git modules + script/makefile...git fails to physically delete the submodules when it has to (i.e after "git pull && git submodules update" the content is still there). So you have to delete the content of the folder experimental_allocator manually. Then update your build script or makefile.
October 06, 2016
On Wednesday, 5 October 2016 at 12:12:24 UTC, Basile B. wrote:
> On Wednesday, 5 October 2016 at 11:45:49 UTC, Laeeth Isharc wrote:
>> I noticed the problem before - previously it was my fault.
>>
>> I had a circulator dependency where A imported B, B did a selective import of C and C imported A selectively.  That led to link problems with module constructors.
>>
>> [...]
>
> It looks like there's a conflict between HackerPilot's fork and the phobos version.
> But HackerPilot's fork is not used anymore. Have you pulled the latest versions recently (or dub upgrade if you use DUB) ?
>
> (verification: https://github.com/economicmodeling/containers/commit/528cae2880c0e5faa57d192621ad0533b0124b7b)

Aha,  thank you.   Obvious after the fact now you point it out,  and I guess that must be it.

Laeeth