Where do I add a template in addExecutable

Edit: It turns out that capy-template was just a name and had no relevance. It seems that Capy build is behind Zig build so there are a number of build errors. I will raise another post to try and sort those out.

Hi. New to Zig. Got a fair way before having to ask for help with a few plain code modules and linking to my C library. Now I need to test GUI. Followed the instructions in Capy for an existing project and all fine except I don’t know where to add the capy-template as addExecutable seems to only take one argument now.

This is what the Capy doc suggests.

const exe = b.addExecutable(“capy-template”, " src/main.zig");

Error says expected one arg got two.

I then tried.

const exe = b.addExecutable(.{
.name = “trunk”,
// In this case the main source file is merely a path, however, in more
// complicated build scripts, this could be a generated file.
.root_source_file = .{ .path = “src/main.zig” },
.target = target,
.optimize = optimize,
.template = “capy-template”,

Error says no field template in Build.ExecutableOptions.

Some help appreciated, thank you, Bob

I hit this recently with Zig dev version too. It was my first time trying to build anything with Zig, so it was a little difficult to fix. But I found that doing “zig init-exe” in an empty directory and looking at the generated build.zig was a good reference for a working build.zig file.

Yes, when I built Capi as a new project I was able to look at the generated files and copy those over to my project, so helpful.
I’ve got this goto project which I use to evaluate new languages. Its complex covering lots of ground and its interesting to see how far I get with it. Tried Rust and got it all pretty much done but Rust is difficult when you start out. No decent GUI with Rust though, ended up using the immediate mode GUI which eats CPU. I’ve now got Capi working but it looks very minimalist at the moment. Most examples don’t build. I doubt it will be good enough for what I want in its current state. I will press on with Zig though as its a lot easier than Rust and the syntax is more Rust than C so I was able to convert some Rust modules quite easily.