Bug 13359 – Multiple definition of `format_c_5b3` with three libraries and local imports

Status
RESOLVED
Resolution
DUPLICATE
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-08-22T18:06:32Z
Last change time
2020-03-21T03:56:38Z
Keywords
link-failure, rejects-valid
Assigned to
No Owner
Creator
Denis Shelomovskii

Comments

Comment #0 by verylonglogin.reg — 2014-08-22T18:06:32Z
The first library is Phobos, probably `-unittest` switch is needed to use its local imports. This code should build fine: m1.d: --- struct S1 { } // should be before `f1` void f1() { import std.ascii; } --- m2.d: --- struct S2 { } // should be before `f2` void f2() { import std.ascii; } --- Command (for Windows): --- dmd -unittest -lib m1.d dmd -unittest -lib m2.d m1.lib --- m2.lib: Error: multiple definition of format_c_5b3: _D9format.1212__ModuleInfoZ and format: _D9format.1212__ModuleInfoZ m2.lib: Error: multiple definition of format_c_5b3: __D9format.129__modtestFZv and format: __D9format.129__modtestFZv --- This is at least major issue as it breaks building libraries and doesn't give any clue of its reason.
Comment #1 by verylonglogin.reg — 2014-11-25T14:02:28Z
So now probably because of this issue we have Issue 13774 which makes current Phobos almost unusable.
Comment #2 by b2.temp — 2019-07-23T01:29:58Z
*** This issue has been marked as a duplicate of issue 13774 ***