Best way to use C library

2023-05-19 Thread Maximilian Naderer via Digitalmars-d-learn
Hello guys, So what’s currently the best way to use a big C library? Let’s assume something like cglm assimp glfw ImportC doesn’t really work for such huge libraries, I’ll investigate further. Deimos is outdated or there are no bindings. I know that there is a dub package for glfw which work

Re: Best way to use C library

2023-05-24 Thread Maximilian Naderer via Digitalmars-d-learn
On Monday, 22 May 2023 at 22:22:50 UTC, Theo wrote: On Friday, 19 May 2023 at 18:31:45 UTC, Maximilian Naderer wrote: .. I’m hope somebody could give me some insights. Thank you ! Kind regards from Austria Max DConf Online '22 - Translating C to D (Dennis Korpel) https://www.youtube.com/wat

Function names, Lib used from C and D

2024-10-22 Thread Maximilian Naderer via Digitalmars-d-learn
Dear community, I want to create a library which is usable from C and D. D should be a first class citizen and C because of FFI for other languages. The lib is compiled with -betterC Because C does not have namespaces i want to add the prefix of the lib like "leogfx" but in D i don't want that

Re: Error with -betterC

2024-11-08 Thread Maximilian Naderer via Digitalmars-d-learn
On Friday, 8 November 2024 at 11:21:33 UTC, Richard (Rikki) Andrew Cattermole wrote: On 09/11/2024 12:10 AM, Maximilian Naderer wrote: Is the -betterC config not creating the equals, hash functions which are generated by D ? I just checked, no. Hello Rikki, Thanks for checking. Just to conf

Easy way for FFI

2024-09-22 Thread Maximilian Naderer via Digitalmars-d-learn
Hello, so what are my / our best options to create an automatic C foreign function interface. I would like to create such interface / header file from a D module with public functions, structs which are declared with extern(C) D code module leo extern(C) void test() { } Expectation: //

Re: Easy way for FFI

2024-09-22 Thread Maximilian Naderer via Digitalmars-d-learn
Hello Richard, Thank you for the info. I thought this goes the other way around. Using a header file and converting it to a .di file. I want to create a .h file from my D modules so you’re saying this should be also possible ?

Error with -betterC

2024-11-08 Thread Maximilian Naderer via Digitalmars-d-learn
I have the following struct with i compile with -betterC into a static library. ```d struct SubmitDesc { union { uint[4] viewport; struct { uint vpx; uint vpy; uint vpw; uint vph; } } union { float[4] c

Re: _memsetFloat Error with dmd

2025-03-17 Thread Maximilian Naderer via Digitalmars-d-learn
On Monday, 17 March 2025 at 12:28:38 UTC, Maximilian Naderer wrote: Hello people, i have the following example. Compiled with dmd and ldc2 dmd main.d -betterC ldc2 main.d -betterC with dmd the compilation fails with lld-link: error: undefined symbol: _memsetFloat >>> referenced by app