Re: Using glibc headers with ImportC

2022-11-13 Thread qua via Digitalmars-d-learn
On Saturday, 12 November 2022 at 14:14:06 UTC, Adam D Ruppe wrote: On Saturday, 12 November 2022 at 13:46:27 UTC, qua wrote: This is supposed to work, right? No, it isn't. And it probably never will. importC looks for a .c file in the current directory. It is that .c file's responsibility to

Re: Using glibc headers with ImportC

2022-11-12 Thread qua via Digitalmars-d-learn
On Saturday, 12 November 2022 at 15:13:36 UTC, bachmeier wrote: You're going to need to use the nightly from here: https://github.com/dlang/dmd/releases/tag/nightly While a lot of progress has been made, it's definitely not finished, so you may still encounter errors here and there. Thanks!

Re: Using glibc headers with ImportC

2022-11-12 Thread qua via Digitalmars-d-learn
On Saturday, 12 November 2022 at 14:57:23 UTC, Adam D Ruppe wrote: I still don't think that's been released yet, so if you aren't on the git master or at least the latest beta build it isn't going to work. Which dmd version are you running? I was running 2.098, I have just installed 2.100.2, w

Re: Using glibc headers with ImportC

2022-11-12 Thread qua via Digitalmars-d-learn
On Saturday, 12 November 2022 at 14:14:06 UTC, Adam D Ruppe wrote: No, it isn't. And it probably never will. importC looks for a .c file in the current directory. It is that .c file's responsibility to #include whatever .h files you want. Okay, thanks, got it. However, I'm still having issue

Re: Using glibc headers with ImportC

2022-11-12 Thread qua via Digitalmars-d-learn
This is supposed to work, right? ``` import stdio; void main() { printf("Hello, World!\n"); } ``` In my case, DMD complains of not being able to read `stdio.d`. What am I doing wrong? I'm not using any compiler switch.

Using glibc headers with ImportC

2022-11-12 Thread qua via Digitalmars-d-learn
I'm trying to get D to use my system's libc. First of all, is such a thing possible with importc? Walter Bright's slides on importc say it should be "as easy as import stdio;", but it doesn't seem to be the case yet. In the specification page I see that importc looks for .c and .i files, not .h