Not-Nik / raylib-zig

Manually tweaked, auto-generated raylib bindings for zig. https://github.com/raysan5/raylib
MIT License
459 stars 101 forks source link

dependency on libc must be explicitly specified in the build command #88

Closed IbrahimOuhamou closed 1 month ago

IbrahimOuhamou commented 1 month ago

when trying to build from my own package (i.e having raylib-zig as a dependency)

zig build
install
└─ install bismi_allah_raylib
   └─ zig build-exe bismi_allah_raylib Debug native 8 errors
/home/ibrahimo/.cache/zig/p/122043ae5d7dc535006aca53271bf37b64fcbb66851a7982f5914fa6166747884f60/lib/raylib-ext.zig:5:12: error: dependency on libc must be explicitly specified in the build command
pub extern "c" fn InitWindow(width: c_int, height: c_int, title: [*c]const u8) void;
           ^~~
referenced by:
    initWindow: /home/ibrahimo/.cache/zig/p/122043ae5d7dc535006aca53271bf37b64fcbb66851a7982f5914fa6166747884f60/lib/raylib.zig:1442:9
    main: src/main.zig:13:7
    remaining reference traces hidden; use '-freference-trace' to see all reference traces
/home/ibrahimo/.cache/zig/p/122043ae5d7dc535006aca53271bf37b64fcbb66851a7982f5914fa6166747884f60/lib/raylib-ext.zig:96:12: error: dependency on libc must be explicitly specified in the build command
pub extern "c" fn SetTargetFPS(fps: c_int) void;
           ^~~
/home/ibrahimo/.cache/zig/p/122043ae5d7dc535006aca53271bf37b64fcbb66851a7982f5914fa6166747884f60/lib/raylib-ext.zig:7:12: error: dependency on libc must be explicitly specified in the build command
pub extern "c" fn WindowShouldClose() bool;
           ^~~
/home/ibrahimo/.cache/zig/p/122043ae5d7dc535006aca53271bf37b64fcbb66851a7982f5914fa6166747884f60/lib/raylib-ext.zig:60:12: error: dependency on libc must be explicitly specified in the build command
pub extern "c" fn BeginDrawing() void;
           ^~~
/home/ibrahimo/.cache/zig/p/122043ae5d7dc535006aca53271bf37b64fcbb66851a7982f5914fa6166747884f60/lib/raylib-ext.zig:59:12: error: dependency on libc must be explicitly specified in the build command
pub extern "c" fn ClearBackground(color: rl.Color) void;
           ^~~
/home/ibrahimo/.cache/zig/p/122043ae5d7dc535006aca53271bf37b64fcbb66851a7982f5914fa6166747884f60/lib/raylib-ext.zig:391:12: error: dependency on libc must be explicitly specified in the build command
pub extern "c" fn DrawText(text: [*c]const u8, posX: c_int, posY: c_int, fontSize: c_int, color: rl.Color) void;
           ^~~
/home/ibrahimo/.cache/zig/p/122043ae5d7dc535006aca53271bf37b64fcbb66851a7982f5914fa6166747884f60/lib/raylib-ext.zig:61:12: error: dependency on libc must be explicitly specified in the build command
pub extern "c" fn EndDrawing() void;
           ^~~
/home/ibrahimo/.cache/zig/p/122043ae5d7dc535006aca53271bf37b64fcbb66851a7982f5914fa6166747884f60/lib/raylib-ext.zig:6:12: error: dependency on libc must be explicitly specified in the build command
pub extern "c" fn CloseWindow() void;
           ^~~
error: the following command failed with 8 compilation errors:
IbrahimOuhamou commented 1 month ago

I just had incomplete build.zig I should have added

const raylib_artifact = raylib_dep.artifact("raylib"); // raylib C library
exe.linkLibrary(raylib_artifact);