Multiple @cImports, conflicting types

My solution to this problem was to create one sdl2_c.zig file and have

pub const SDL = @cImport({
    @cInclude("SDL2/SDL.h");
    @cInclude("SDL2/SDL_image.h");
});

in there and my other zig files import that zig file. Then the Zig compiler worked it out correctly.

6 Likes