digitalmars.D.bugs - [Issue 22804] New: [REG 2.099] compiling mutliple files without
- d-bugmail puremagic.com (45/47) Feb 21 2022 https://issues.dlang.org/show_bug.cgi?id=22804
https://issues.dlang.org/show_bug.cgi?id=22804 Issue ID: 22804 Summary: [REG 2.099] compiling mutliple files without linking produces broken object files Product: D Version: D2 Hardware: All OS: Windows Status: NEW Severity: regression Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: r.sagitario gmx.de Compile these two files: // xfile.d module file; // xstring.d module xstring; string[] tokenizeArgs(string text) { return []; } /////// withdmd -m32mscoff -c xfile.d xstring.dand link them with // main.d import xstring; void main(string[] args) { auto arr = tokenizeArgs(args[0]); } viadmd -m32mscoff main.d xfile.obj xstring.objcauses xstring.obj : error LNK2005: __D5xfile12__ModuleInfoZ already defined in xfile.obj main.obj : error LNK2019: unresolved external symbol __D7xstring12tokenizeArgsFAyaZAQf referenced in function __Dmain main.exe : fatal error LNK1120: 1 unresolved externals Error: linker exited with status 1120 a) xstring.obj contains a definition for the module xfile b) the symbol for tokenizeArgs is missing from xstring.obj Looking at the object files, it seems xfile,obj is repeated inside of xstring.obj --
Feb 21 2022