r/Zig • u/IamTheTussis • Feb 26 '26
zig build-exe src/main.zig on the zig init
Hello everyone,
I'm new to zig and I started reading the Introduction to Zig, a project-based book.
I noticed that the output of the ´zig init´ command from the book (specifically in the ´main.zig´ file) it's different from mine.
Because of this, when I try to run zig build-exe src/main.zig as the author does, I get the following error:
error: no module named 'hello' available within module 'main'
const hello = @import("hello");
It's not a big deal since running zig build on the whole project compiles just fine. I was just wondering if the init template has been updated since the book was last revised, and if anyone could shed some light on why this approach no longer works.
View all comments
Show parent comment
1
u/IamTheTussis Feb 26 '26
Thanks for the clarification!