obscure messages relating to linking and imports in 2.071.1

Laeeth Isharc via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Oct 5 04:45:49 PDT 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.



More information about the Digitalmars-d-learn mailing list