VulkanMemoryAllocator
VulkanMemoryAllocator copied to clipboard
undefined symbol: 'vkGetDeviceBufferMemoryRequirements' and 'vkGetDeviceImageMemoryRequirements'
I use VScode+clang+mingw32-make
on Windows system
- I download project from source
- use CMake GUI set build with "MinGW Makefile", click
configure
andgenerate
- then run
mingw32-make
andmingw32-make install
- then use the vma lib in my project
- the CmakeLists.txt:
add_library(vulkan STATIC IMPORTED)
set_target_properties(vulkan PROPERTIES IMPORTED_LOCATION F:/VulkanSDK/1.2.135.0/Lib/vulkan-1.lib)
add_library(vma STATIC IMPORTED)
set_target_properties(vma PROPERTIES IMPORTED_LOCATION E:/Lib/VulkanMemoryAllocator-master/VulkanMemoryAllocator-master/build/install/lib/libVulkanMemoryAllocator.a)
target_link_libraries(Turbo PUBLIC vulkan vma)
6.then build the project, the output:
How do I fix this problem
While I rebuild the vma lib, inexplicably succeeded... What???? ˃̣̣̥᷄⌓˂̣̣̥᷅
That new functions come from Vulkan 1.3. Please make sure all your source files use Vulkan headers form the same SDK version. Might be related to #247
That new functions come from Vulkan 1.3. Please make sure all your source files use Vulkan headers form the same SDK version. Might be related to #247
Got the same problem. Strange, because I created a CMake interface library which provides the VMA include directory (with some other things) and other projects depend on this lib (which in fact depends on the found Vulkan::Vulkan
). This means that the same SDK (1.3.211.0) is used in my case. (I don't know if it's a complete bullshit, but can it happen that my video card / driver does not support Vulkan 1.3?)
It is easy to fix tho (as you've suggested in your comment), I just had to define the VMA_VULKAN_VERSION
by hand:
#define VMA_VULKAN_VERSION 1000000
In my opinion, this version selection logic could be forced by the user of the lib instead of using defaults. The reason is that even if Vulkan 1.3 is available with the SDK, the target platform might be 1.2, 1.1 or even 1.0. Also, a helper macro could be useful, something like VMA_MAKE_VULKAN_VERSION(VK_API_VERSION_1_0)
I just add VMA
in to my project, like this:
and in the project root
CMakeLists.txt
:
...
add_subdirectory(./thirdparty)
...
and the ./thirdparty/CMakeLists.txt
...
add_subdirectory(./VulkanMemoryAllocator)
...
then this issue fixed.
you can watch this: https://www.youtube.com/watch?v=ED-WUk440qc&list=PLalVdRk2RC6o5GHu618ARWh0VO0bFlif4&index=3
for detail you can get my project at: https://github.com/FuXiii/Turbo
Hope them can help you
maybe you must use Vulkan 1.3
to compile VMA
┑( ̄Д  ̄)┍
For others with this issue: All my API versions were set to 1.3 (instance creation and vma creation). However, my GPU (1070) only supported Vulkan 1.2. Updating my GPU drivers resolved the issue.
I've added documentation regarding selecting Vulkan version on compile time as well as runtime.
The idea for macro VMA_MAKE_VULKAN_VERSION(VK_API_VERSION_1_0)
looks great. I tried to implement it. Unfortunately, this is not possible, as Vulkan macros that define or extract Vulkan API version use integer arithmetic, type casting etc. that is not supported during preprocessing, while it is needed inside VMA in lines like this:
#if VK_KHR_buffer_device_address || VMA_VULKAN_VERSION >= 1002000
So I decided to leave VMA_VULKAN_VERSION
to be defined manually by the user.