Re: How to Use D's ImportC Compiler in a Program

2025-10-18 Thread David T. Oxygen via Digitalmars-d-learn
On Tuesday, 7 October 2025 at 17:00:51 UTC, Dejan Lekic 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 gi

Re: How to Use D's ImportC Compiler in a Program

2025-10-18 Thread Manfred Nowak via Digitalmars-d-learn
On Tuesday, 7 October 2025 at 00:56:26 UTC, David T. Oxygen wrote: [...] ```c #include int main(){ printf("Hello World!\n"); return 0; } ``` Compilable without errors or warnings, when dmd 2.111.0 and "Visual Studio" 2019 and 2026 are installed under win11.

How to Use D's ImportC Compiler in a Program

2025-10-18 Thread David T. Oxygen via Digitalmars-d-learn
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. I thought the compiler was broken but when I compile a normal D file it can work. I've also tried `dmd a.d

Re: How to Use D's ImportC Compiler in a Program

2025-10-18 Thread jmh530 via Digitalmars-d-learn
On Sunday, 12 October 2025 at 10:49:33 UTC, David T. Oxygen wrote: On Wednesday, 8 October 2025 at 02:00:59 UTC, Steven Schveighoffer wrote: [...] -- Thank you for your help,but I still haven't solved my problem. I reinstalled DMD 2.111.0 today,it's the newest relaese version. However,the comp

Re: How to Use D's ImportC Compiler in a Program

2025-10-17 Thread David T. Oxygen via Digitalmars-d-learn
On Wednesday, 8 October 2025 at 02:00:59 UTC, Steven Schveighoffer wrote: Who knows why? I'm waiting for your answer. Which D compiler, and version? I used DMD 2.110.1 when compiling. Now I know it should be able to compile C files. 2.110.1 does not exist. Where did you get this compiler f

Re: How to Use D's ImportC Compiler in a Program

2025-10-17 Thread David T. Oxygen via Digitalmars-d-learn
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

Re: How to Use D's ImportC Compiler in a Program

2025-10-17 Thread Ali Çehreli via Digitalmars-d-learn
On 10/6/25 5:56 PM, David T. Oxygen wrote: > Nothing special.Just a simple Hello-World application. > ```c > #include > int main(){ > printf("Hello World!\n"); > return 0; > } > ``` > Just like the example on the D website. I put that code into hello.c and compiled. Yes, there are some

Re: How to Use D's ImportC Compiler in a Program

2025-10-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On Sunday, 12 October 2025 at 10:49:33 UTC, David T. Oxygen wrote: Thank you for your help,but I still haven't solved my problem. I reinstalled DMD 2.111.0 today,it's the newest relaese version. However,the compiler still keep silent when compiling `dmd hello.c`...(If it can't compile,at last i

Re: How to Use D's ImportC Compiler in a Program

2025-10-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On Wednesday, 8 October 2025 at 01:38:03 UTC, David T. Oxygen wrote: On Tuesday, 7 October 2025 at 17:00:51 UTC, Dejan Lekic 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 h

Re: How to Use D's ImportC Compiler in a Program

2025-10-07 Thread David T. Oxygen via Digitalmars-d-learn
I think if it couldn't compile, at last it should warn me. But sadly, it not. It just did *nothing*.

Re: How to Use D's ImportC Compiler in a Program

2025-10-07 Thread Dejan Lekic via Digitalmars-d-learn
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. I thought the compiler was broken but wh

Re: How to Use D's ImportC Compiler in a Program

2025-10-06 Thread Emmanuel via Digitalmars-d-learn
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. I thought the compiler was broken but wh