-
Notifications
You must be signed in to change notification settings - Fork 132
Open
Description
I created the hello_world project using the zig init command and then ran zig build-exe src/main.zig per section 1.2.4. It results in the following error:
% zig build-exe src/main.zig
src/main.zig:2:29: error: no module named 'hello_world' available within module 'main'
const hello_world = @import("hello_world");
^~~~~~~~~~~~~
referenced by:
main: src/main.zig:7:9
callMain [inlined]: /opt/homebrew/Cellar/zig/0.15.2/lib/zig/std/start.zig:627:37
callMainWithArgs [inlined]: /opt/homebrew/Cellar/zig/0.15.2/lib/zig/std/start.zig:587:20
main: /opt/homebrew/Cellar/zig/0.15.2/lib/zig/std/start.zig:602:28
1 reference(s) hidden; use '-freference-trace=5' to see all referencesFurthermore, it looks like the files created using the init command are a bit different to those in the book. Output is different and the add function is declared using pub instead of export.
Is there a specific version of Zig I should have installed while working through the book?
sixcy
Metadata
Metadata
Assignees
Labels
No labels