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 bachmeier via Digitalmars-d-learn
On Saturday, 12 November 2022 at 15:08:22 UTC, qua wrote: 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

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,

Re: Using glibc headers with ImportC

2022-11-12 Thread Adam D Ruppe via Digitalmars-d-learn
On Saturday, 12 November 2022 at 14:39:14 UTC, qua wrote: Do I have to do anything else? I've read that importc doesn't have a preprocessor and I assume it is related to that, however "ImportC can automatically run the C preprocessor associated with the Associated C Compiler". I still don't

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

Re: Using glibc headers with ImportC

2022-11-12 Thread Adam D Ruppe via Digitalmars-d-learn
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 #include whatever .h files you want.

Sorted Array (Container) Type

2022-11-12 Thread Per Nordlöw via Digitalmars-d-learn
Have anybody created a wrapper container ```d struct Sorted(ArrayLike, alias lessThanPred) ``` that wraps an array-like type `ArrayLike` so that it's always sorted according to the binary predicate `lessThanPred`?

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

Re: ImportC linking issue

2022-11-12 Thread confuzzled via Digitalmars-d-learn
On Saturday, 12 November 2022 at 12:48:40 UTC, confuzzled wrote: Right, so I figured that the dependencies for for libxlsxio_read would be resolved when it was being compiled/linked. Therefore, when I used it later, I would just need to import its and include it on the command line. I didn't

Re: ImportC linking issue

2022-11-12 Thread confuzzled via Digitalmars-d-learn
On Saturday, 12 November 2022 at 11:44:06 UTC, Mike Parker wrote: On Saturday, 12 November 2022 at 10:02:12 UTC, confuzzled wrote: On Saturday, 12 November 2022 at 08:43:13 UTC, Mike Parker wrote: On Saturday, 12 November 2022 at 02:45:52 UTC, confuzzled wrote: The linker doesn't care if the

Re: ImportC linking issue

2022-11-12 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 12 November 2022 at 10:02:12 UTC, confuzzled wrote: On Saturday, 12 November 2022 at 08:43:13 UTC, Mike Parker wrote: On Saturday, 12 November 2022 at 02:45:52 UTC, confuzzled wrote: The linker doesn't care if the libraries are C or D, and the compiler is only involved in that

Re: ImportC linking issue

2022-11-12 Thread confuzzled via Digitalmars-d-learn
On Saturday, 12 November 2022 at 08:43:13 UTC, Mike Parker wrote: On Saturday, 12 November 2022 at 02:45:52 UTC, confuzzled wrote: The linker doesn't care if the libraries are C or D, and the compiler is only involved in that you can pass flags to the linker via the compiler command line.

Re: ImportC linking issue

2022-11-12 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 12 November 2022 at 02:45:52 UTC, confuzzled wrote: It seems that every time I resolve one of these undefined symbols issues, the compiler finds more. So I keep copying lib files from locations that are a path, to my working directory and linking them to my script. Is that the