// Used to add SSFN support.
const ssfn = b.addTranslateC(.{
.link_libc = false,
.optimize = optimize,
.target = target,
.root_source_file = b.path("dist/vendor/ssfn.c"),
});
kernel.root_module.addImport("ssfn", ssfn.createModule());
I am attempting to use a header-only library in my freestanding hobby kernel project.
ZLS accepts the generated code, but I get linker errors when compiling like so:
error: ld.lld: undefined symbol: ssfn_putc
note: referenced by Console.zig:34 (/home/jacob/Code/eltoro/src/term/Console.zig:34)
note: /home/jacob/Code/eltoro/.zig-cache/o/6bf4f95c85ea13bcb49be9d82807ccd2/eltoro.o:(term.Console.init)
Just to confirm, the function is defined further down in the header file, and I renamed it to end in .c thinking that would fix it.
Any help is greatly appreciated!