#Can't find module, but methods are recognized

1 messages · Page 1 of 1 (latest)

haughty dew
#

what command are you running + can we see your build.zig

#

its probably because youre running a step that doesnt add zglfw as a module

#

exe.root_import.addImport("foo", ...) should do it, which is what you're doing

#

gonna try to recreate this

#

sure

#

i just recreated from what you gave so far and it worked tho so :P

#

zig build works for me worksonmymachine

#

ahhhhh yeah so zig build-exe does not use your build.zig

to get the same behavior you have to pass flags, which is what zig build is doing for you

#

if you do zig build --verbose it will show you the command it actually runs

#

yep, its listing all of the c files its compiling

#

you have to use that command (minus the --listen parts, and probably the cache parts too)

#

of course you can turn the absolute paths into relative paths and anything you have in PATH

#

it'd be a lot

#

oh for this project its three commands, two build-libs and one build-exe

#

no, its the entire output of zig build --verbose

#

just get rid of any mention of caching, and it'll probably work

#

which is why i'd recommend just using zig build :P

#

zig build will put the exe into zig-out/bin

#

lol

#

np zeroLike

#

btw, it only does that because this line tells it to:

    // This declares intent for the executable to be installed into the
    // standard location when the user invokes the "install" step (the default
    // step when running `zig build`).
    b.installArtifact(exe);

without it the exe stays in the cache dir iirc