Closed jdoleary closed 11 months ago
Could it be related to being a single-file header-only library?
Oh, sorry, I didn't read fully the explanation, I thought it was not working...
Zig allows for setting C defines in the build script, so maybe we could look into that?
Zig allows for setting C defines in the build script, so maybe we could look into that?
I will look into this!
I was successfully able to define RAYGUI_IMPLEMENTATION in build.zig with the following:
exe.defineCMacroRaw("RAYGUI_IMPLEMENTATION");
However, I'm still working on getting the raygui.h to be added in build.zig. The way that raylib is added to the build doesn't seem to apply to a header-only library like raygui.h because I can't invoke raylib.addCSourceFiles
on a .h file. I assumed adding raygui as a static library and adding the include path would be sufficient but it is not and I am getting error: lld-link: undefined symbol: GuiButton
even though I've defined the extern fn in a new zig file and added raygui.h as a static library. This makes me suspect the build isn't parsing the raygui.h file. I will continue to post here as I make progress for posterity.
You probably need to add an extra C file that includes raygui, so the functions actually get compiled
You probably need to add an extra C file that includes raygui, so the functions actually get compiled
I tried this to no avail. I've uploaded a PR with my attempt: https://github.com/Not-Nik/raylib-zig/pull/39/files in case you want to take a look. I'm still working on it and I can tell I'm getting closer but it's just not there yet.
Hi, I'd love to help add support for raygui bindings to this repo.
I'm quite new to zig but making progress quickly. I got raygui working in a fork of this repo. If you're in the raylib discord you can see my results here:
I think my first attempt isn't idiomatic but it works. As you can see in the above link, I had to import raylib again in order to get the raygui import working, so I'm sure there's a better way than what I did.
Thoughts?