January 04, 2022 [Issue 22651] New: undefined reference to ModuleInfo when using imported | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=22651 Issue ID: 22651 Summary: undefined reference to ModuleInfo when using imported Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1 Component: phobos Assignee: nobody@puremagic.com Reporter: tim.dlang@t-online.de Compiling the following files with dmd nightly results in a linker error: ///////////////////// a.d ///////////////////// import c; import std; imported!q{b}.C obj; void main() { Appender!string appender; std.file.write("test.txt", appender.data); } ///////////////////// b.d ///////////////////// import c; class C { } ///////////////////// c.d ///////////////////// import std; /////////////////////////////////////////////// Compiling it with dmd a.d b.d c.d produces the following output: /usr/bin/ld: a.o:(.data.rel.ro+0x50): undefined reference to `_D3std8internal6memory12__ModuleInfoZ' collect2: error: ld returned 1 exit status Error: linker exited with status 1 The error goes away if a custom definition of imported is used. dmd nightly has to be used, because imported is not available with dmd 2.098.1. -- |
Copyright © 1999-2021 by the D Language Foundation