#How do compile glfw as a lib for zig?

1 messages · Page 1 of 1 (latest)

sly dome
#

The question's wording is ambiguous, could mean a few things:

  • if you want to use glfw with zig you need a wrapper of some kind. either using translate-c or cImport, or using an existing ziggified wrapper
  • If you already have a wrapper, and want to compile glfw as a library then you can use the existing glfw buildsystem to compile either a dynamic or static library, and then link your application with it
  • If you want hands-off-don't-care use glfw with zig, then use an existing wrapper, like mach-glfw or zig-gamedev's wrapper (I believe called zglfw)
#

Mentioning the differences because compile glfw as a lib and using a C library with Zig are separate topics that are used as equivalent in the title, but they aren't the same

mint juniper
sly dome
#

The clarification makes the question even more ambiguous
can you explain what you are trying to achieve? What is your end-goal?

#

are you making an engine, or a game, or an application of some other type. whats the end goal exactly?

mint juniper
#

as in .lib/.a

sly dome
mint juniper
#

cmake can't compile it to mingw

sly dome
sly dome
#

mingw is not worth your time at all, ever

#

zigcc simplifies that process 100 fold, and also solves every other cross-compilation platform, all at once

sly dome
# mint juniper isn't zglfw outdated?

Might be. I use my own simple version, so I don't keep up with it
That said, glfw changes very little
Unless you are going for wayland-only-mandatory-for-linux, then the latest glfw patches are not that revolutionary

mint juniper
sly dome
#

I wish I could give exact steps, but how to do that depends on their buildsystem setup,
so you need to follow their instructions
and I don't use them myself so I can't give any detailed insights there

mint juniper
#

are there any guides?

sly dome
#

In the simplified version that I use I just call their cmake, but I currently don't cross compile, so I don't remember details

sly dome
# mint juniper are there any guides?

they should be in their readme
if you have never used a zig library as a module, though, then the official buildsystem tutorial should explain most of what you need

sly dome
mint juniper
#

So this will somehow produce a .a/.lib from the c code?

sly dome
mint juniper
#

I'm given no clear instruction on what to do to compile the necessary .a file for zig

sly dome
sly dome