Giter Site home page Giter Site logo

Comments (7)

raysan5 avatar raysan5 commented on May 14, 2024

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...

from raylib-zig.

Not-Nik avatar Not-Nik commented on May 14, 2024

Zig allows for setting C defines in the build script, so maybe we could look into that?

from raylib-zig.

jdoleary avatar jdoleary commented on May 14, 2024

Zig allows for setting C defines in the build script, so maybe we could look into that?

I will look into this!

from raylib-zig.

jdoleary avatar jdoleary commented on May 14, 2024

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.

from raylib-zig.

Not-Nik avatar Not-Nik commented on May 14, 2024

You probably need to add an extra C file that includes raygui, so the functions actually get compiled

from raylib-zig.

jdoleary avatar jdoleary commented on May 14, 2024

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.

from raylib-zig.

jdoleary avatar jdoleary commented on May 14, 2024

#39 (comment)

from raylib-zig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.