You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m working on a hobby project with mixed Zig and C programming.
The "Run Test" button provided by the vscode-zig extension fails to compile when the project requires linking to C libraries.
Run Test
Command failed: C:\Users\PC\scoop\shims\zig.EXE test --test-filter keyword d:\projects\starlight\src\parser\tokenizer.zig
D:\projects\starlight\src\parser\tokenizer.zig:1:11: error: C import failed
D:\projects\starlight\src\parser\tokenizer.zig:1:11: note: libc headers not available; compilation does not link against libc
C:\Users\PC\AppData\Local\zig\o\e3f7f0f004f28d89132de840b129a16d\cimport.h:1:10: error: 'parser/token.h' file not found
Debug Test
Command failed: C:\Users\PC\scoop\shims\zig.EXE test d:\projects\starlight\src\parser\tokenizer.zig --test-filter keyword --test-no-exec -femit-bin=d:\projects\starlight\zig-out\tmp-debug-build\bin\test-tokenizer
D:\projects\starlight\src\parser\tokenizer.zig:1:11: error: C import failed
D:\projects\starlight\src\parser\tokenizer.zig:1:11: note: libc headers not available; compilation does not link against libc
C:\Users\PC\AppData\Local\zig\o\d88f36432145d60ca7a16061bebdc714\cimport.h:1:10: error: 'parser/token.h' file not found
However, running the command zig test -lc -Isrc src/parser/tokenizer.zig src/parser/lexer.c in the command line compiles and runs the tests without any issues.
PS D:\projects\starlight> zig test -lc -Isrc src/parser/tokenizer.zig src/parser/lexer.c
All 4 tests passed.
I noticed the vscode-zig extension doesn't support custom flags for zig test. Could you please consider adding this feature? It would be very helpful.
The text was updated successfully, but these errors were encountered:
I’m working on a hobby project with mixed Zig and C programming.
The "Run Test" button provided by the vscode-zig extension fails to compile when the project requires linking to C libraries.
Run Test
Debug Test
However, running the command
zig test -lc -Isrc src/parser/tokenizer.zig src/parser/lexer.c
in the command line compiles and runs the tests without any issues.I noticed the vscode-zig extension doesn't support custom flags for zig test. Could you please consider adding this feature? It would be very helpful.
The text was updated successfully, but these errors were encountered: