Big Temp
Big Temp

Reputation: 454

vulkan.hpp bindings generate WinAPI errors

I reinstalled Visual Studio 2019 and installed Vulkan SDK (the latest version) for Windows but while there are no problems with vulkan.h, vulkan.hpp generates identifier HMODULE is undefined error right after including it.

This is the snippet with error:

#if defined(__linux__) || defined(__APPLE__)
    void *m_library;
#elif defined(_WIN32)
    HMODULE m_library;
#else
#error unsupported platform
#endif

Am I supposed to define something before including it or what? In the official repo of Khronos Group it is stated that all I need is visual studio 2015 or newer. I'm also getting 2 compiler errors related to LoadLibrary and FreeLibrary functions which msvc can't seem to find too.

Upvotes: 0

Views: 525

Answers (1)

Drake Wu
Drake Wu

Reputation: 7210

As you said, The platform-specific surface creation functions need be enabled using defines. For Windows you need to define VK_USE_PLATFORM_WIN32_KHR in your project’s windows build configuration

Upvotes: 2

Related Questions