-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
I'm using Zig 0.15.1 on WIndows, trying to make an app with GLFW+GL3 as the backend while learning Zig. My build file looks like this pretty much:
const std = @import("std");
pub fn build( b: *std.Build ) void {
const target = b.standardTargetOptions( .{} );
const optimize = b.standardOptimizeOption( .{} );
// Create app module:
const app_module = b.createModule(.{
.root_source_file = b.path("src/demo.zig"),
.target = target,
.optimize = optimize,
});
// Add compile-time info constants (for app name and semantic version):
const app_info_options = b.addOptions();
// ...
app_module.addOptions("app_info", app_info_options );
// Create app binary:
const app_exe = b.addExecutable(.{
.name = "demo",
.root_module = app_module,
});
const zglfw_dep = b.dependency( "zglfw", .{ .target = target } );
app_exe.root_module.addImport( "zglfw", zglfw_dep.module("root") );
app_exe.linkLibrary( zglfw_dep.artifact("glfw") );
const zopengl_dep = b.dependency("zopengl", .{} );
app_exe.root_module.addImport( "zopengl", zopengl_dep.module("root") );
const zmath_dep = b.dependency( "zmath", .{} );
app_exe.root_module.addImport( "zmath", zmath_dep.module("root") );
const zstbi_dep = b.dependency( "zstbi", .{} );
app_exe.root_module.addImport( "zstbi", zstbi_dep.module("root") );
const zgui_dep = b.dependency("zgui", .{
.backend = .glfw_opengl3,
.shared = false,
});
app_exe.root_module.addImport( "zgui", zgui_dep.module("root") );
app_exe.linkLibrary( zgui_dep.artifact("imgui") );
b.installArtifact( app_exe );
}
And the deps in my build.zig.zon looks like:
.dependencies = .{
.zglfw = .{
.url = "git+https://github.com/zig-gamedev/zglfw#82da052ccace5690f323876046d3062c9c573283",
.hash = "zglfw-0.10.0-dev-zgVDNK6oIQAamIbSG6JGubpBiQSxrv_lymMIsub2DBNa",
},
.zopengl = .{
.url = "git+https://github.com/zig-gamedev/zopengl#e5b00b6957ceeacc7e980d6f34b1da663e39554c",
.hash = "zopengl-0.6.0-dev-5-tnz9g8CQBbUiEouos-P6EE87Gf0GWUzsMh9XDvAtLP",
},
.zmath = .{
.url = "git+https://github.com/zig-gamedev/zmath#3a5955b2b72cd081563fbb084eff05bffd1e3fbb",
.hash = "zmath-0.11.0-dev-wjwivdMsAwD-xaLj76YHUq3t9JDH-X16xuMTmnDzqbu2",
},
.zstbi = .{
.url = "git+https://github.com/zig-gamedev/zstbi#2c4b3100ccb7aed90ecc9439030899764e2a8d47",
.hash = "zstbi-0.11.0-dev-L0Ea_yaWBwAHwFoCuyjkFyaiSsbjt4UOrkntR0c_nmzz",
},
.zgui = .{
.url = "git+https://github.com/zig-gamedev/zgui#7bc9461997c402c1be9bc716388399404df1686e",
.hash = "zgui-0.6.0-dev--L6sZO_HbQBW30QfIGHgKhjxShc_o4wBeJZ0hga5IA0c",
},
},
Everything was compiling fine until I tried to add zgui, but now I get some build error mentioning freetype:
C:\Users\Laptop\AppData\Local\zig\p\freetype-0.0.0-AAAAAA5JcwBMujojfNLEq5g_WijZtU56mRLYx8bjjiMU\build.zig:10:18: error: no field or member function named 'addStaticLibrary' in 'Build'
const lib = b.addStaticLibrary(.{
~^~~~~~~~~~~~~~~~~
C:\Users\Laptop\AppData\Roaming\Code\User\globalStorage\ziglang.vscode-zig\zig\x86_64-windows-0.15.1\lib\std\Build.zig:1:1: note: struct declared here
const std = @import("std.zig");
^~~~~
C:\Users\Laptop\AppData\Local\zig\p\freetype-0.0.0-AAAAAA5JcwBMujojfNLEq5g_WijZtU56mRLYx8bjjiMU\build.zig:10:18: note: method invocation only supports up to one level of implicit pointer dereferencing
C:\Users\Laptop\AppData\Local\zig\p\freetype-0.0.0-AAAAAA5JcwBMujojfNLEq5g_WijZtU56mRLYx8bjjiMU\build.zig:10:18: note: use '.*' to dereference pointer
referenced by:
runBuild__anon_126514: C:\Users\Laptop\AppData\Roaming\Code\User\globalStorage\ziglang.vscode-zig\zig\x86_64-windows-0.15.1\lib\std\Build.zig:2214:33
dependencyInner__anon_117658: C:\Users\Laptop\AppData\Roaming\Code\User\globalStorage\ziglang.vscode-zig\zig\x86_64-windows-0.15.1\lib\std\Build.zig:2195:29
13 reference(s) hidden; use '-freference-trace=15' to see all references
Any ideas what's wrong?
Metadata
Metadata
Assignees
Labels
No labels