← Back to index
|
Original Bugzilla link
Bug 18321 – undefined reference to __ModuleInfoZ depending on whether module is imported directly or indirectly
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2018-01-28T07:37:45Z
Last change time
2022-11-16T04:19:47Z
Assigned to
No Owner
Creator
Timothee Cour
Comments
Comment #0
by timothee.cour2 — 2018-01-28T07:37:45Z
dmd -oftest3 -version=B main.d #ok dmd -oftest3 -version=A main.d Undefined symbols for architecture x86_64: "_D4foo24util12__ModuleInfoZ", referenced from: _D4main12__ModuleInfoZ in test3.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ```d module main; version(A) import foo2.util; version(B) import foo2.util2; void main(){fun;} module foo2.util2; public import foo2.util; module foo2.util; void fun()(){ // these cause the link error import std.path; //import std.file; /+ // these are ok import std.stdio; import std.range; import std.algorithm; +/ } ```
Comment #1
by alphaglosined — 2022-11-16T04:19:47Z
Not a bug. You did not compile in the other modules into your binary. For small projects you can use -i to automatically compile in the other modules.