I would like to work through Build your own lisp book using Zig and C combined just for learning Zig 0.13. However the following step requires me to download mpc.c and mpc.h to my Zig project and include them. So far I have been able to understand how to add the mpc.c file in build.zig like exe.addCSourceFile(.{.file = b.path("src/mpc.c") });
. However when trying to include the mpc.h file i get errors that the file is not found.
const c = @cImport({
@cInclude("editline/readline.h");
@cInclude("mpc.h");
});
This works good for readline.h which is a system requirement but not for my local mpc.h file.
What am I missing, also in the link provided is says that mpc depends on the math lib so I will likely also have to depend on -lm when compiling.