travisvroman / kohi

A game engine made as part of the Kohi Game Engine series on YouTube (and Twitch!), where we make a game engine from the ground up using C and Vulkan.
https://kohiengine.com
Apache License 2.0
1.06k stars 100 forks source link

[macOS] Build error re: Vulkan #235

Closed shaps80 closed 2 months ago

shaps80 commented 4 months ago

First off, just want to thank you for this amazing project and related videos. I'm right at the beginning but really enjoying it so far! Learning a lot. I'm a Swift developer for  platforms so it's also been interesting re-learning C – you have a really great, clean approach IMO. Anyway, thanks!

Describe the bug I installed Vulkan and I think setup correctly through environment. From either command line or in VSCode everything seems to "build" fine, but when I try to "run" I get the following in the output:

Error opening library: dlopen(libkohi.plugin.renderer.vulkan.dylib, 0x0002): Library not loaded: @rpath/libvulkan.1.dylib
  Referenced from: <A630A10B-6FAC-377C-84FD-FF728A7299BF> /Users/shaps/Developer/kohi/bin/libkohi.plugin.renderer.vulkan.dylib
  Reason: tried: './libvulkan.1.dylib' (no such file)

Desktop (please complete the following information):

travisvroman commented 2 months ago

@shaps80 Thanks for reporting this! It took me a while to get to the bottom of this issue. I pushed a small temporary fix into the release/v0.8.0 branch. Basically it seems that the way the new Vulkan SDK install works changed the path where the libvulkan.1.dylib is located, seemingly even when the global install option is selected.

I'll need to come up with a more permanent solution in the future, but the changes are here: https://github.com/travisvroman/kohi/commit/86fc6ac3eede389ecef2ec996c26de4c91e076c4

Please let me know if this helps.

travisvroman commented 2 months ago

Closing this. If this doesn't fix the issue, please feel free to re-open.