Hi
I am trying to import the raylib library as a dll into my new zig project, but struggling a bit with the build steps for this.
I have created a new ini-exe project and added the raylib dlls and header files into a libs folder.
In my build.zig, I have tried to link to the dll and header includes as
exe.linkSystemLibrary("libs/dyn/raylib.dll");
exe.addIncludePath(.{ .path = "libs/includes" });
b.installArtifact(exe);
My main.zig file is
const std = @import("std");
const ray = @cImport({
@cInclude("raylib.h");
@cInclude("rlgl.h");
@cInclude("raygui.h");
});
pub fn main() !void {
ray.InitWindow(800, 600, "raylib [core] example - test basic window");
defer ray.CloseWindow();
while (!ray.WindowShouldClose()) {
ray.BeginDrawing();
defer ray.EndDrawing();
ray.ClearBackground(ray.RAYWHITE);
ray.DrawText("Congrats! You created your first window!", 190, 200, 20, ray.LIGHTGRAY);
}
}
I am not able to give the proper path to the dll it seems. I have tried a lot of approaches, including copying the dll to my zig-out folder and the project root but I am able to link them successfully. Any ideas what I am doing wrong?
zig build-exe raydil Debug native: error: error: unable to find Dynamic system library 'raylib.dll' using strategy 'paths_first'. searched paths: none