Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] fails to build with GCC13 #359

Closed
werdahias opened this issue Jul 24, 2023 · 6 comments
Closed

[Bug] fails to build with GCC13 #359

werdahias opened this issue Jul 24, 2023 · 6 comments
Labels
bug Something isn't working input needed Waiting for more information

Comments

@werdahias
Copy link

When preparing an upload for the debian package I noticed this library fails to build with GCC13.
Log:


make[3]: Entering directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
[ 50%] Building CXX object src/CMakeFiles/VulkanMemoryAllocator.dir/VmaUsage.cpp.o
cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src && /usr/bin/c++ -DVMA_DEBUG_ALWAYS_DEDICATED_MEMORY=0 -DVMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT=0 -DVMA_DEBUG_GLOBAL_MUTEX=0 -DVMA_DEBUG_INITIALIZE_ALLOCATIONS=0 -DVMA_DYNAMIC_VULKAN_FUNCTIONS=0 -DVMA_RECORDING_ENABLED=0 -DVMA_STATIC_VULKAN_FUNCTIONS=1 -I/<<PKGBUILDDIR>>/include -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=c++14 -MD -MT src/CMakeFiles/VulkanMemoryAllocator.dir/VmaUsage.cpp.o -MF CMakeFiles/VulkanMemoryAllocator.dir/VmaUsage.cpp.o.d -o CMakeFiles/VulkanMemoryAllocator.dir/VmaUsage.cpp.o -c /<<PKGBUILDDIR>>/src/VmaUsage.cpp
In file included from /<<PKGBUILDDIR>>/src/VmaUsage.h:91,
                 from /<<PKGBUILDDIR>>/src/VmaUsage.cpp:30:
/<<PKGBUILDDIR>>/src/../include/vk_mem_alloc.h: In function ‘void VmaUint32ToStr(char*, size_t, uint32_t)’:
/<<PKGBUILDDIR>>/src/../include/vk_mem_alloc.h:2817:9: error: ‘snprintf’ was not declared in this scope
 2817 |         snprintf(outStr, strLen, "%u", static_cast<unsigned int>(num));
      |         ^~~~~~~~
/<<PKGBUILDDIR>>/src/../include/vk_mem_alloc.h:2651:1: note: ‘snprintf’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
 2650 |     #include <mutex>
  +++ |+#include <cstdio>
 2651 | #else
/<<PKGBUILDDIR>>/src/../include/vk_mem_alloc.h: In function ‘void VmaUint64ToStr(char*, size_t, uint64_t)’:
/<<PKGBUILDDIR>>/src/../include/vk_mem_alloc.h:2821:9: error: ‘snprintf’ was not declared in this scope
 2821 |         snprintf(outStr, strLen, "%llu", static_cast<unsigned long long>(num));
      |         ^~~~~~~~
/<<PKGBUILDDIR>>/src/../include/vk_mem_alloc.h:2821:9: note: ‘snprintf’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
/<<PKGBUILDDIR>>/src/../include/vk_mem_alloc.h: In function ‘void VmaPtrToStr(char*, size_t, const void*)’:
/<<PKGBUILDDIR>>/src/../include/vk_mem_alloc.h:2825:9: error: ‘snprintf’ was not declared in this scope
 2825 |         snprintf(outStr, strLen, "%p", ptr);
      |         ^~~~~~~~
/<<PKGBUILDDIR>>/src/../include/vk_mem_alloc.h:2825:9: note: ‘snprintf’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
make[3]: *** [src/CMakeFiles/VulkanMemoryAllocator.dir/build.make:79: src/CMakeFiles/VulkanMemoryAllocator.dir/VmaUsage.cpp.o] Error 1

It built fine with with GCC12.

@adam-sawicki-a
Copy link
Contributor

What version of the library do you use? If you use the latest of Releases, which is more than 1 year old now, please pick the latest code from the "master" branch.

Likely duplicate of #326, #329, #333.

@adam-sawicki-a adam-sawicki-a added bug Something isn't working input needed Waiting for more information labels Jul 25, 2023
@werdahias
Copy link
Author

I am indeed using the latest release. I can cherry-pick those fixes. A new release would also be nice

@adam-sawicki-a
Copy link
Contributor

Yes, I know it would be good to create a new release. Unfortunately I don't have time for it - too many tasks at work. Creating new release is tracked as #318. In the meantime I recommend picking latest code from the "master" branch.

@werdahias
Copy link
Author

ok, thanks :)

@deccer
Copy link

deccer commented May 19, 2024

It's been almost a year. Is there a chance to get a new release before it turns 1? :)

(Sorry for posting in a closed issue, saw it too late)

@adam-sawicki-a
Copy link
Contributor

The topic of new release is discussed in #318. I agree it would be good to tag a new release. I will do it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working input needed Waiting for more information
Projects
None yet
Development

No branches or pull requests

3 participants