[Issue 24669] New: ImportC: C files are not compiled with '-i' flag
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Jul 20 22:50:57 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24669
Issue ID: 24669
Summary: ImportC: C files are not compiled with '-i' flag
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: ImportC, link-failure
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: dave287091 at gmail.com
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.
--
More information about the Digitalmars-d-bugs
mailing list