SDL2 binary Integration

Hello guys !

I’m trying to learn Zig, it’s not my first project on it but i have got some difficulties with sdl.

I come from Javascript so a system language is very difficult for me to understand some concepts.

I want to integrate SDL2 binaries, i have the local framework named SDL2.framework, i have linked the framework in my build and now i’m trying to cImport it on my main.zig but i got the error “file not found”, i have tried many many path before coming here but no success. If someone can help me please.

There is my github project : GitHub - anonymze/zig-sdl

Ano.

I don’t have SDL2.framework, but here’s how I’ve been building with SDL recently.

build.zig.zon adds the SDL source (with zig build system) tree as a dependency.
build.zig then links against it.

3 Likes

Thank you for your quick response ! It helped me understand some things.

I was only doing zig run src/main.zig. So the link to the framework was not included in the run because i was not using the build step. Now if i do zig build run with the step included in your git it works better :slight_smile:

Thank you !

1 Like