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
946 stars 92 forks source link

Debian 12 <semaphore.h> dependecy. #222

Closed ElectricLizzzard closed 21 minutes ago

ElectricLizzzard commented 4 months ago

I'm trying to compile the Kohi Engine, however it asks for a very specific dependency <sys/semaphore.h>. There is no package that would resolve the dependency, all i found is "semaphore.h" that is being the part of linux-kernel-headers but have no idea what to do with it. I am totally confused and stuck on this step.

`Building for Linux... Building everything on linux (debug)... --- Performing versiongen debug build --- Linking versiongen... --- Performing engine debug build --- engine/src/core/systems_manager.c... engine/src/platform/platform_nix.c... engine/src/platform/platform_nix.c:19:10: fatal error: 'sys/semaphore.h' file not found

include <sys/semaphore.h>

     ^~~~~~~~~~~~~~~~~

1 error generated. make: *** [Makefile.library.mak:180: obj/engine/src/platform/platform_nix.c.o] Помилка 1 error:`

Dr-42 commented 2 months ago

I fixed it on my local build by changing it from sys/semaphore.h to just semaphore.h

Also I was getting no function definition for kthread_wait and I wrote my own version and everything seems to be working.

I am on Arch linux with KDE plasma 6 DE.

travisvroman commented 21 minutes ago

@ElectricLizzzard Thanks for submitting this!

Catching up on issues - apologies for the delay! I had to dig back a bit for this since it was technically resolved a while ago. #224 was as well.

Anyway, ultimately the issue was the fact that kthread_wait was never defined on the mac platform (nor linux seemingly) at the time this was written up. Anything version 0.6 and before would have been wrong here for those platforms. You'll need to use 0.7.0 or newer and this is fixed. For mac specifically, you'll want to use 0.7.1 or newer.

Closing this.