How to Use D's ImportC Compiler in a Program

David T. Oxygen TKC847567 at outlook.com
Tue Oct 7 00:56:26 UTC 2025


On Monday, Oct.6 2025 at 17:10:36 UTC, Emmanuel wrote:
> On Monday, 6 October 2025 at 15:20:06 UTC, David T. Oxygen 
> wrote:
>> I once found that D has a ImportC compiler. It can compile C 
>> code.
>> How to use it?
>> I tried `dmd hello.c` but it didn't work. Instead,it did 
>> nothing,and even didn't give me an error message.
> Hi,
>
> can you show what's in your hello.c file ??
>
> Thanks.
--
Nothing special.Just a simple Hello-World application.
```c
#include<stdio.h>
int main(){
     printf("Hello World!\n");
     return 0;
}
```
Just like the example on the D website.

And what in it doesn't matter. The compiler didn't work,no matter 
what code.

I think if my compiler's version is too low to support ImportC...


More information about the Digitalmars-d-learn mailing list