Bug 24669 – ImportC: C files are not compiled with '-i' flag
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-07-20T22:50:57Z
Last change time
2024-08-11T12:43:32Z
Keywords
ImportC, link-failure
Assigned to
No Owner
Creator
dave287091
Comments
Comment #0 by dave287091 — 2024-07-20T22:50:57Z
Consider the following source code layout:
```
main.d
foo.c
```
with files
main.d:
```
import foo;
void main(){
foo.foo();
}
```
foo.c:
```
extern int puts(const char*);
void foo(void){ puts(“foo"); }
```
`dmd -i main.d` fails with undefined reference to `foo`, indicating that foo.c is not being compiled.