Hi all -
I’m working on a small OS mostly written in Zig but with a small amount of assembly. I’m using Zig 0.14.0-dev .
Here is the error I’m getting -
andy@obsidian:~/Zig-DOS$ zig build
/home/andy/Zig-DOS/build.zig:47:28: error: expected type ‘Build.LazyPath’, found ‘*const [36:0]u8’
kernel.addAssemblyFile(“./src/kernel/kernel_asm/interrupts.s”);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/andy/zig/lib/std/Build.zig:2171:22: note: union declared here
pub const LazyPath = union(enum) {
^~~~~
/home/andy/zig/lib/std/Build/Step/Compile.zig:873:51: note: parameter type declared here
pub fn addAssemblyFile(compile: *Compile, source: LazyPath) void {
^~~~~~~~
referenced by:
runBuild__anon_8818: /home/andy/zig/lib/std/Build.zig:2116:27
main: /home/andy/zig/lib/compiler/build_runner.zig:301:29
remaining reference traces hidden; use ‘-freference-trace’ to see all reference traces
andy@obsidian:~/Zig-DOS$
The statement creating the error is this -
kernel.addAssemblyFile(“./src/kernel/kernel_asm/interrupts.s”);
This is the addAssemblyFile function in the Zig source code -
pub fn addAssemblyFile(self: *LibExeObjStep, path: const u8) void {
self.link_objects.append(.{
.assembly_file = .{ .path = self.builder.dupe(path) },
}) catch unreachable;
}
I tried to make sense of that function as it relates to the statement but I’m having problems understanding how my statement is wrong.
Hoping someone may be able to help - many thanks in advance.
- mooseman