jpbruyere / vkhelpers

Vulkan c helper library
MIT License
32 stars 10 forks source link

Build fails on recent versions of GCC #15

Closed chrismile closed 1 year ago

chrismile commented 1 year ago

The build of vkvg/vkhelpers fails on recent versions of GCC (as used, e.g., in Manjaro or Arch Linux). This is due to a missing #include <cstdio> in VmaUsage.cpp / vk_mem_alloc.h. It seems new versions of VMA now have added this include statement for snprintf, so I think this bug should be easy to fix by updating to a new version of VMA. It seems like the version of VMA shipped with this library is a bit outdated by now.

jpbruyere commented 1 year ago

see:

https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/issues/332

Wanted to put the following comment:

Except having well aligned memory chunks, does this library has another utility?

chrismile commented 1 year ago

see:

GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator#332

Wanted to put the following comment:

Except having well aligned memory chunks, does this library has another utility?

So if I understood the discussion in the linked issue report correctly, new versions of VMA have an issue with C++14 or earlier on Linux/BSD? In this case, would adding #include <cstdio> to VmaUsage.cpp instead of updating VMA be a solution for you for the problems with snprintf in vkhelpers? Or would you suggest adding -DVKH_USE_VMA=OFF when compiling vkvg?

jpbruyere commented 1 year ago

I've pushed the include of cstdio into master as a quick fix, VKH_USE_VMA is broken after I split vma in a separate lib.

chrismile commented 1 year ago

Thanks, it now again compiles on recent versions of GCC.