Re: Intro to calling C libraries

2025-02-24 Thread Ian via Digitalmars-d-learn
Sweet!

Re: Intro to calling C libraries

2025-02-23 Thread Bradley Chatha via Digitalmars-d-learn
On Thursday, 20 February 2025 at 21:10:29 UTC, Ian wrote: ... Another cool aspect of ImportC is that you can use the D compiler's header generator to generate .di files from C sources - i.e. semi-automatic, native binding generation! I say semi-automatic since it misses out things like macr

Re: Intro to calling C libraries

2025-02-23 Thread Dejan Lekic via Digitalmars-d-learn
On Thursday, 20 February 2025 at 20:09:29 UTC, Ian wrote: What is the recommended documentation or introductory material on how to call C libraries from D? I've seen it done in GtkD (for GTK3) and I have heard of -betterC, but it's all a little overwhelming. (I'm an experienced C programmer but

Re: Intro to calling C libraries

2025-02-20 Thread Ian via Digitalmars-d-learn
On Thursday, 20 February 2025 at 21:05:40 UTC, Lance Bachmeier wrote: Normally, you should be using ImportC. Look at the quick example from the spec: https://dlang.org/spec/importc.html#examples The first line of hello.c looks like this: ``` #include ``` When ImportC compiles a C file, it

Re: Intro to calling C libraries

2025-02-20 Thread Lance Bachmeier via Digitalmars-d-learn
On Thursday, 20 February 2025 at 20:09:29 UTC, Ian wrote: Hi, What is the recommended documentation or introductory material on how to call C libraries from D? I've seen it done in GtkD (for GTK3) and I have heard of -betterC, but it's all a little overwhelming. (I'm an experienced C programm