vkCreateDebugReportCallback EXT not linking, but every other functions in vulkan.h works perfectly

强颜欢笑 提交于 2019-12-23 13:41:12

问题


So I have been trying to learn Vulkan lately, and while trying to get the validation layers to work, I got error LNK2019:

1>Renderer.obj : error LNK2019: unresolved external symbol vkCreateDebugReportCallbackEXT referenced in function "private: void __cdecl Renderer::_InitDebug(void)" (?_InitDebug@Renderer@@AEAAXXZ)

Now the odd thing is that every other function in vulkan.h works perfectly.

I have vulkan-1.lib linked, and I run the AMD implementation of vulkan. The library is from the Vulkan SDK.


回答1:


The debugging functions from debug_report_ext are not part of the Vulkan core. You need to dynamically load them from the instance via vkGetInstanceProcAddr after making sure that it's actually supported:

PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallback = VK_NULL_HANDLE;
CreateDebugReportCallback = (PFN_vkCreateDebugReportCallbackEXT)vkGetInstanceProcAddr(instance, "vkCreateDebugReportCallbackEXT");

See my Vulkan debugging helper unit for details.



来源:https://stackoverflow.com/questions/37900051/vkcreatedebugreportcallback-ext-not-linking-but-every-other-functions-in-vulkan

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!