Problem with ImportC example?
ryuukk_
ryuukk.dev at gmail.com
Tue Jan 17 17:36:41 UTC 2023
On Tuesday, 17 January 2023 at 17:12:49 UTC, DLearner wrote:
> On Tuesday, 17 January 2023 at 15:55:40 UTC, bachmeier wrote:
>> On Tuesday, 17 January 2023 at 13:21:37 UTC, DLearner wrote:
>>> On Tuesday, 17 January 2023 at 11:21:08 UTC, Dennis wrote:
>>>> On Tuesday, 17 January 2023 at 11:16:25 UTC, DLearner wrote:
>>>>> ```
>>>>>
>>>>> C:\Users\SoftDev\Documents\BDM\D\ImportC>dmd ex01.c
>>>>> ex01.c(1): Error: C preprocessor directive `#include` is
>>>>> not supported
>>>>> ex01.c(1): Error: no type for declarator before `#`
>>>>> ex01.c(5): Error: no type for declarator before `return`
>>>>> ex01.c(6): Error: no type for declarator before `}`
>>>>> ```
>>>>
>>>> What is your `dmd --version`? I suspect you have a version
>>>> where you still have to manually pre-process the .c file,
>>>> instead of a more recent version which invokes the
>>>> pre-processor itself.
>>>
>>> ```
>>> C:\Users\SoftDev>dmd --version
>>> DMD32 D Compiler v2.100.2-dirty
>>> Copyright (C) 1999-2022 by The D Language Foundation, All
>>> Rights Reserved written by Walter Bright
>>>
>>> ```
>>
>> You may want to use the nightly build if you're working with
>> ImportC: https://github.com/dlang/dmd/releases/tag/nightly
>> They're doing a lot of work with it.
>
> Downloaded latest dmd for windows from website:
> ```
> C:\Users\SoftDev>dmd --version
> DMD32 D Compiler v2.101.2-dirty
> Copyright (C) 1999-2022 by The D Language Foundation, All
> Rights Reserved written by Walter Bright
> ```
>
> But trial still failed:
>
> ```
> C:\Users\SoftDev\Documents\BDM\D\ImportC>dmd ex01.c
> failed launching cl.exe /P /Zc:preprocessor /PD /nologo ex01.c
> /FIC:\D\dmd2\windows\bin\..\..\src\druntime\import\importc.h
> /Fiex01.i
> Error: C preprocess command cl.exe failed for file ex01.c, exit
> status 1
>
> ```
It works for me
```
C:\Users\ryuukk\tmp>dmd -run ex01.c
hello world
```
Double check your visual studio installation, something is wrong
with your install probably
More information about the Digitalmars-d-learn
mailing list