Mach engine

Hello, all,

I don’t know if this topic belongs in this section, I will move it elsewhere if it does not.

I am trying to use the mach engine, and following the instructions on the machengine website, it is not compiling.

I put this in the dependencies section of the build.zig.zon file:

    zig fetch --save https://pkg.machengine.org/mach/173ed0cf01542ab22facb8535ed8364211f2f0f4.tar.gz"

And ran zig build run, but it didn’t compile. So I added a comma at the end of it, and got the same result. Then I added quotes between the zig and gz with a comma after the concluding quotation mark and same result.

This is the result I get:

/home/jf/Library/Programs/ZIG/GAMES/LEARNING_MACH/build.zig.zon:64:13:

error:

expected ‘,’ after initializer

    zig fetch --save "https://pkg.machengine.org/mach/173ed0cf01542ab22facb8535ed8364211f2f0f4.tar.gz",

^~~~~

I appreciate anyone’s help.

You’re meant to run that command, not put it in your build.zig.zon.

Will do that. Thanks for the swift reply!

I ran the command and got this error:

zig fetch --save https://pkg.machengine.org/mach/173ed0cf01542ab22facb8535ed8364211f2f0f4.tar.gz

zig-pkg/.tmp-435853114f49167c/mach-173ed0cf01542ab22facb8535ed8364211f2f0f4/build.zig.zon:2:13:

error:

expected enum literal

.name = "mach",

But the second line is a comment.

.{
// This is the default name used by packages depending on this one. For
// example, when a user runs zig fetch --save <url>, this field is used
// as the key in the dependencies table. Although the user can choose a
// different name, most users will stick with this provided value.
//
// It is redundant to include “zig” in this name because it is already
// within the Zig package namespace.
.name = “mach”,

You need to use the correct Zig version: Nominated Zig versions | Mach: zig game engine & graphics toolkit

1 Like

An alternative is to browse Mach’s forks to see if someone’s made a fork for newer Zig versions that you can use as a dependency for now.

Will check. Thanks a lot!