Skip to content

"vulkan/vulkan.h" file not found. #35

Open
@TRDJ90

Description

@TRDJ90

I wanted to try out zgui glfw_vulkan backend on my mac.
When i tried to compile the project i got the following compiler error

.cache/zig/p/zgui-0.6.0-dev--L6sZMGHaAB-y1HhtLJ3CXhfoMOOi4RAJDdnr_IGYKoh/libs/imgui/backends/imgui_impl_vulkan.h:59:10: 
error: 'vulkan/vulkan.h' file not found
#include <vulkan/vulkan.h>

.cache/zig/p/zgui-0.6.0-dev--L6sZMGHaAB-y1HhtLJ3CXhfoMOOi4RAJDdnr_IGYKoh/libs/imgui/backends/imgui_impl_vulkan.cpp:89:10: note: in file included from /Users/_/.cache/zig/p/zgui-0.6.0-dev--L6sZMGHaAB-y1HhtLJ3CXhfoMOOi4RAJDdnr_IGYKoh/libs/imgui/backends/imgui_impl_vulkan.cpp:89:
#include "imgui_impl_vulkan.h"

I don't know enough about zig build system but i tried adding the vulkan sdk include path to the exe. And created my own c.zig file to be sure it could find the vulkan.h file.

build.zig

const env_map = try std.process.getEnvMap(b.allocator);
if (env_map.get("VULKAN_SDK")) |path| {
    exe.addIncludePath(.{ .cwd_relative = try std.fmt.allocPrint(b.allocator, "{s}/include", .{path}) });
}

c.zig

pub usingnamespace @cImport({
    @cInclude("vulkan/vulkan.h");
});

The cImport was able to find the "vulkan/vulkan.h" file but adding the includepath didn't help with zgui to find "vulkan/vulkan.h" file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions