I am trying to use vulkan on raspberry pi 3 A+ (32-bit, Cortex-A53).
Raspberry OS:
pi@pi:~/Downloads/mesa_vulkan $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
I run this code on raspberry:
#include <vulkan/vulkan.h>
int main(void)
{
VkInstanceCreateInfo createInfo{};
createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
VkInstance instance;
VkResult result = vkCreateInstance(&createInfo, nullptr, &instance);
}
with these arguments:
g++ main.cpp -I ./VulkanFiles/ -L./VulkanFiles -lvulkan_radeon -lVkLayer_MESA_overlay -o ./CompiledFiles/main.out
where I have my vulkan header files in VulkanFiles/Vulkan
And I get:
in function `main':
main.cpp:(.text+0x38): undefined reference to `vkCreateInstance'
What I am unsure of, is if I use the correct library file(s). I use libvulkan_radeon.so
which was downloaded using sudo apt install mesa-vulkan-drivers
, as I saw in this tutorial (So I didnt compile the library on my own)
- Are
libvulkan_radeon.so
andlibVkLayer_MESA_overlay.so
the only library files I need to compile my main.cpp? - Where is vkCreateInstance() function stored? Maybe I am missing some libraries?|