我需要得到特定于平台的xrGetInstanceProcAddr,我在windows上,语言是C,API是vulkan。
在运行以下代码时,出现了"extern未定义符号xrGetInstanceProcAddr“错误:
#define XR_USE_PLATFORM_WIN32
#define XR_USE_GRAPHICS_API_VULKAN
#ifdef XR_USE_PLATFORM_WIN32
#include <Windows.h>
#endif
#include "../openxr/openxr.h"
#include "../openxr/openxr_platform.h"
#include "../openxr/openxr_platform_defines.h"
#include "../openxr/openxr_reflection.h"
main(int argc, char** argv)
{
XrResult result = XR_SUCCESS;
uint32_t ext_count = 0;
PFN_xrEnumerateInstanceExtensionProperties qxrEnumerateInstanceExtensionProperties;
result = xrGetInstanceProcAddr(XR_NULL_HANDLE, "xrEnumerateInstanceExtensionProperties", (PFN_xrVoidFunction*)&qxrEnumerateInstanceExtensionProperties);
result = qxrEnumerateInstanceExtensionProperties(NULL, 0, &ext_count, NULL);
}发布于 2022-04-05 20:45:03
需要openxr加载程序。在visual中,nuget包管理器:
安装-Package OpenXR.Loader -Version 1.0.10.2
https://stackoverflow.com/questions/71741815
复制相似问题