-
Notifications
You must be signed in to change notification settings - Fork 35
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
How to get it up and running #18
Comments
if u wanna add this to your project do the following:
As you can see i'm building a static library in this example and depending on the os.tag i'm conditionally including the |
Thanks for providing these instructions @eddineimad0. Note that these instructions will only work for a limited window of Zig versions, for example Also in most cases you'll want to add There's also one correction in these instructions, the line |
P.S. I should also mention that soon Zig's package manager should be ready and with that you'll be able to add an entry in build.zig.zon .{
.name = "myexample",
.version = "0.0.0",
.dependencies = .{
.zigwin32 = .{
.url = "https://github.com/marlersoft/zigwin32/archive/b70e7f818d77a0c0f39b0bd9c549e16439ff5780.tar.gz",
.hash = "TODO PUT CORRECT HASH HERE",
},
},
} The const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const zigwin32_dep = b.dependency("zigwin32", .{
.target = target,
.optimize = optimize,
});
const exe = b.addExecutable(.{
.name = "hellowindows",
.root_source_file = .{ .path = "hellowindows.zig" },
.target = target,
.optimize = optimize,
});
exe.addModule("win32", zigwin32_dep);
b.installArtifact(exe);
}
|
@marler8997 would you mind putting this in the readme file ? it would also help to create releases so we can just use |
I tried
zig build
and I ended up with this.I am on a Macbook pro (Intel).
Also, this was my first time ever running zig at all. Do I need to use that generator repo first? Let me know if I am missing anything if you can, thanks!
The text was updated successfully, but these errors were encountered: