Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raylib doesn't build with Zig 0.14.0 #4814

Open
10aded opened this issue Mar 6, 2025 · 1 comment
Open

Raylib doesn't build with Zig 0.14.0 #4814

10aded opened this issue Mar 6, 2025 · 1 comment

Comments

@10aded
Copy link

10aded commented Mar 6, 2025

Issue description

Raylib fails to build with zig build for the current standard version of Zig, 0.14.0.

One of both of build.zig and build.zig.zon need to be updated to work with Zig 0.14.0.

Issue Screenshot

PS C:\Users\10aded\Documents\Temp\Raylib-Curr> zig version
0.14.0
PS C:\Users\10aded\Documents\Temp\Raylib-Curr> zig build
C:\Users\10aded\Documents\Temp\Raylib-Curr\build.zig.zon:2:13: error: expected enum literal
    .name = "raylib",
            ^~~~~~~~
PS C:\Users\10aded\Documents\Temp\Raylib-Curr>
@demilich1
Copy link

Are you sure about this? It seems to work for me. Here are the steps I took (using zig 0.14.0 ofc):

  1. Create new empty directory
  2. use zig init to initialize a new Zig project
  3. zig fetch --save=raylib https://github.com/raysan5/raylib/archive/f1385f3.zip (most recent commit as of this writing)
  4. Add the following block to build.zig:
// Raylib include
const raylib_dep = b.dependency("raylib", .{ .target = target, .optimize = optimize });
const raylib = raylib_dep.artifact("raylib");
exe.linkLibrary(raylib);
  1. Add example code to main.zig to open a window
  2. zig build run -> Works

I think the error message is actually complaining about your build.zig.zon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants