D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 13359 - Multiple definition of `format_c_5b3` with three libraries and local imports
Summary: Multiple definition of `format_c_5b3` with three libraries and local imports
Status: RESOLVED DUPLICATE of issue 13774
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 major
Assignee: No Owner
URL:
Keywords: link-failure, rejects-valid
Depends on:
Blocks:
 
Reported: 2014-08-22 18:06 UTC by Denis Shelomovskii
Modified: 2020-03-21 03:56 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Denis Shelomovskii 2014-08-22 18:06:32 UTC
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 Denis Shelomovskii 2014-11-25 14:02:28 UTC
So now probably because of this issue we have Issue 13774 which makes current Phobos almost unusable.
Comment 2 basile-z 2019-07-23 01:29:58 UTC

*** This issue has been marked as a duplicate of issue 13774 ***