# Error linking Raylib via raylib-zig

**URL:** <https://ziggit.dev/t/error-linking-raylib-via-raylib-zig/3384>\
**Category:** Help\
**Tags:** build-system, ecosystem, raylib\
**Created:** [February 27, 2024, 11:01am UTC](https://ziggit.dev/t/error-linking-raylib-via-raylib-zig/3384 "2024-02-27T11:01:14Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Sze](https://ziggit.dev/user_avatar/ziggit.dev/sze/32/496_2.png) [@Sze](https://ziggit.dev/u/Sze)\
**Post date:** [February 27, 2024, 9:16pm UTC](https://ziggit.dev/t/error-linking-raylib-via-raylib-zig/3384/6 "2024-02-27T21:16:51Z")

</div>

The `addRaylib` function is part of [raylib/src/build.zig at master · raysan5/raylib · GitHub](https://github.com/raysan5/raylib/blob/master/src/build.zig) the function is part of raylib and is used by some people to add raylib to their projects. (It seems `Not-Nik/raylib-zig` doesn’t use that function and instead writes its own function however it seems that code gets loaded and run together with the main `build.zig` causing the error message)

The problem is that `Not-Nik/raylib-zig` uses `https://github.com/raysan5/raylib/archive/5.0.tar.gz` if you download that and look into it, you can see that that uses `std.Build.CompileStep` in `src/build.zig` however you are trying to compile it with a version of zig that is too new where it needs to be updated to `std.Build.Step.Compile`.

You have 3 options:

1. you downgrade to an older version of zig somewhere between your current version and the one specified in `Not-Nik/raylib-zig`’s readme:

2. you update `Not-Nik/raylib-zig` `build.zig.zon`’s url+hash to point to a newer raylib commit and update `Not-Nik/raylib-zig`’s `build.zig` if necessary.

3. Alternatively you could try using raylib directly without the bindings (that is what I am doing, one indirection less to worry about), here is an example project: [Raylib example using the package manager](https://ziggit.dev/t/raylib-example-using-the-package-manager/1787)

Either way let us know what you have tried and if it worked, or presented you with any other errors.

Personally I think `2.` is probably your best choice if you are used to using the bindings and should be doable, the difficult thing is just getting used to the whole picking commits and what to do to update stuff.

---

_[View the full topic](https://ziggit.dev/t/error-linking-raylib-via-raylib-zig/3384)._
