I’m trying to include C source files in build.zig and I’ve been running into this error whilst trying to find all c files in a given directory. I’m using code from this blog post. I’m using version 0.11.0. Here’s the error output.
expected type 'void', found 'error{SystemResources,SymLinkLoop,ProcessFdQuotaExceeded,SystemFdQuotaExceeded,DeviceBusy,Unexpected,FileNotFound,NotDir,InvalidHandle,AccessDenied,NameTooLong,NoDevice,InvalidUtf8,BadPathName,NetworkNotFound}'
var dir = try std.fs.cwd().openIterableDir(C_ROOT_DIR, .{ .access_sub_paths = true });
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/applejeewce/zig/mizumi/build.zig:6:29: note: function cannot return an error
I triple checked the directory, and even changed it up multiple times but I keep getting the same error. I’m on macOS.
I’d really appreciate any pointers that could help resolve this
Thank you