Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't 'zig build run' on windows #16897

Closed
GmosNM opened this issue Aug 20, 2023 · 6 comments
Closed

can't 'zig build run' on windows #16897

GmosNM opened this issue Aug 20, 2023 · 6 comments
Labels
bug Observed behavior contradicts documented or intended behavior

Comments

@GmosNM
Copy link

GmosNM commented Aug 20, 2023

Zig Version

0.11,0

Steps to Reproduce and Observed Behavior

zig build run

the output is:
Semantic Analysis [667] error(mingw): clang exited with code 1 and stderr: error: unknown target triple 'x86-unknown-windows-gnu', please use -triple or -arch

Semantic Analysis [1768] error(mingw): clang exited with code 1 and stderr: error: unknown target triple 'x86-unknown-windows-gnu', please use -triple or -arch

Semantic Analysis [4957] error(mingw): clang exited with code 1 and stderr: error: unknown target triple 'x86-unknown-windows-gnu', please use -triple or -arch

error: unable to generate DLL import .lib file for advapi32: ClangPreprocessorFailed

Expected Behavior

build and run the program

@GmosNM GmosNM added the bug Observed behavior contradicts documented or intended behavior label Aug 20, 2023
@Vexu
Copy link
Member

Vexu commented Aug 21, 2023

This looks similar to ziglang/zig-bootstrap#144, how did you acquire your Zig binary?

@GmosNM
Copy link
Author

GmosNM commented Aug 21, 2023

@GmosNM
Copy link
Author

GmosNM commented Aug 21, 2023

PS D:\dev> cd o
PS D:\dev\o> ls
PS D:\dev\o> zig init-exe
info: Created build.zig
info: Created src\main.zig
info: Next, try `zig build --help` or `zig build run`
PS D:\dev\o> zig build run
Semantic Analysis [735] error(mingw): clang exited with code 1 and stderr: error: unknown target triple 'x86-unknown-windows-gnu', please use -triple or -arch

Semantic Analysis [1742] error(mingw): clang exited with code 1 and stderr: error: unknown target triple 'x86-unknown-windows-gnu', please use -triple or -arch

Semantic Analysis [4957] error(mingw): clang exited with code 1 and stderr: error: unknown target triple 'x86-unknown-windows-gnu', please use -triple or -arch

error: unable to generate DLL import .lib file for advapi32: ClangPreprocessorFailed
PS D:\dev\o>

@GmosNM
Copy link
Author

GmosNM commented Aug 21, 2023

fixed it

PS D:\dev\o> zig build run
Hello, world!
PS D:\dev\o>

i downloaded zig-windows-x86_64-0.11.0.zip
i was using zig-windows-x86_64-0.11.0.zip

@GmosNM GmosNM closed this as completed Aug 21, 2023
@gphilipp
Copy link

I have the same problem, and I don't understand how you fixed it as your previous comments points to the same packages 🤔

@tim-tim707
Copy link

Same issue, fixed using zig-windows-x86_64-0.11.0 instead of zig-windows-x86-0.11.0 (x86_64 instead of x86)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

4 participants