Bug 21487 – ModuleInfo not found when compiling with -lib and -betterC
Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-12-18T12:31:58Z
Last change time
2022-11-16T04:23:02Z
Keywords
betterC, rejects-valid
Assigned to
No Owner
Creator
Max Samukha
Comments
Comment #0 by maxsamukha — 2020-12-18T12:31:58Z
object.d:
---
module object;
// struct ModuleInfo; // (1)
unittest {
}
---
dmd -lib -betterC -unittest object.d
Error: ModuleInfo not found. object.d may be incorrectly installed or corrupt
ModuleInfo should not be required. Uncomment (1) to work around.
Comment #1 by alphaglosined — 2022-11-16T04:23:02Z
The problem here is the inclusion of the object module, you should not include one for compilation in -betterC.
Without the object.d module, this works correctly.