ImportC and #include files

jmh530 john.michael.hall at gmail.com
Mon May 8 13:22:44 UTC 2023


On Saturday, 6 May 2023 at 01:07:15 UTC, bachmeier wrote:
> On Saturday, 6 May 2023 at 00:35:46 UTC, jmh530 wrote:
>> On Friday, 5 May 2023 at 23:05:02 UTC, bachmeier wrote:
>>> On Friday, 5 May 2023 at 22:56:20 UTC, bachmeier wrote:
>>>
>>>> Maybe I can come up with a simpler/more practical example 
>>>> without the complexity of this library. This is the first 
>>>> time ImportC has worked well enough for me to compile C 
>>>> files.
>>>
>>> Here's a simpler example using math.h that works for me:
>>>
>>> https://gist.github.com/bachmeil/6da28f934454864b7ddf80e2d1eaa5e5
>>
>> I’m afk this weekend, but I didn’t have a .c file that 
>> included the math header. I just wanted to use the c header 
>> directly in the d file. I want to try having a blank .c file 
>> that includes the math header and see if I can use that with D.
>
> I updated the gist so the c file contains only `#include 
> <math.h>`. It works.

I was able to get nlopt's tutorial example working with importC. 
I can write a bit more up later.

The only thing that I wasn't able to get working was using the 
HUGE_VAL macro in math.h. Would anyone else be able to confirm if 
they are able to get that working?



More information about the Digitalmars-d mailing list