I noticed that this demo wouldn't build due to using c_void which is no longer supported. I updated that call to use anyopaque, and then got this error when building:
$ zig build
./zig-cache/o/7d0536ad2271b7a3554bfdda65614ef9/cimport.zig:23447:60: error: expected function, found '?fn([*c].cimport:1:11.struct_SDL_RWops) callconv(.C) c_int'
pub inline fn SDL_RWclose(ctx: anytype) @TypeOf(ctx.*.close(ctx)) {
^
./zig-cache/o/7d0536ad2271b7a3554bfdda65614ef9/cimport.zig:23447:41: note: called from here
pub inline fn SDL_RWclose(ctx: anytype) @TypeOf(ctx.*.close(ctx)) {
^
./src/main.zig:6:21: note: called from here
pub fn main() !void {
^
I can't make any sense out of this error. The problem certainly seems to be with calling SDL_RWclose; indeed, when the defer that contains this call is commented out the program builds and runs as expected.
The message error: expected function, found '?fn([*c].cimport:1:11.struct_SDL_RWops) callconv(.C) c_int' makes me wonder if there is something going wrong at the C interop layer.
I noticed that this demo wouldn't build due to using
c_void
which is no longer supported. I updated that call to useanyopaque
, and then got this error when building:I can't make any sense out of this error. The problem certainly seems to be with calling
SDL_RWclose
; indeed, when thedefer
that contains this call is commented out the program builds and runs as expected.The message
error: expected function, found '?fn([*c].cimport:1:11.struct_SDL_RWops) callconv(.C) c_int'
makes me wonder if there is something going wrong at the C interop layer.I found a recent reference to the problem with
c_void
, but no other reports of this particular build problem.