You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling in Visual Studio (MSVC), the following error is produced:
------ Build started: Project: VulkanHppModuleLib, Configuration: Debug x64 ------
Scanning sources for module dependencies...
Compiling...
vulkan.cppm
C:\VulkanSDK\1.4.304.0\Include\vulkan\vulkan.cppm(2701,31): error C2039: 'PFN_VoidFunction': is not a member of 'vk'
C:\VulkanSDK\1.4.304.0\Include\vulkan\vulkan.cppm(29,18): see declaration of 'vk'
C:\VulkanSDK\1.4.304.0\Include\vulkan\vulkan.cppm(2701,3): error C2873: 'PFN_VoidFunction': symbol cannot be used in a using-declaration
Done building project "VulkanHppModuleLib.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
Commenting out line 2701 of Vulkan.cppm fixes the issue and allows compilation.
The visual studio project was generated with this cmake code:
function (VE_Create_Vulkan_hpp_module)
# find Vulkan SDK
find_package( Vulkan REQUIRED )
# Require Vulkan version ≥ 1.3.256 (earliest version when the Vulkan module was available)
if( ${Vulkan_VERSION} VERSION_LESS "1.3.256" )
message( FATAL_ERROR "Minimum required Vulkan version for C++ modules is 1.3.256. "
"Found ${Vulkan_VERSION}."
)
endif()
message(STATUS "Vulkan_INCLUDE_DIR='${Vulkan_INCLUDE_DIR}'")
add_library( VulkanHppModuleLib )
target_sources( VulkanHppModuleLib PRIVATE
FILE_SET CXX_MODULES
BASE_DIRS ${Vulkan_INCLUDE_DIR}
FILES "${Vulkan_INCLUDE_DIR}/vulkan/vulkan.cppm"
)
target_include_directories(VulkanHppModuleLib
PUBLIC
"${Vulkan_INCLUDE_DIR}"
)
target_compile_features( VulkanHppModuleLib PUBLIC cxx_std_23 )
target_link_libraries( VulkanHppModuleLib PUBLIC Vulkan::Vulkan )
endfunction()
The text was updated successfully, but these errors were encountered:
I can confrm this. The module only compiles when line 2701 is commented or replaced with
using ::PFN_vkVoidFunction;
The error code generated with clang:
D:/VulkanSDK/1.4.304.0/Include/vulkan/vulkan.cppm:2701:9: error: no member named 'PFN_VoidFunction' in namespace'vk'; did you mean '::PFN_vkVoidFunction'?
2701 | using VULKAN_HPP_NAMESPACE::PFN_VoidFunction;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ::PFN_vkVoidFunction
D:\VulkanSDK\1.4.304.0\Include/vulkan/vulkan_hpp_macros.hpp:220:32: note: expanded from macro 'VULKAN_HPP_NAMESPACE'220 | # define VULKAN_HPP_NAMESPACE vk
| ^
D:\VulkanSDK\1.4.304.0\Include/vulkan/vulkan_core.h:3122:26: note: '::PFN_vkVoidFunction' declared here
3122 | typedefvoid (VKAPI_PTR *PFN_vkVoidFunction)(void);
This missing typedef has been added by #2033, but apparently that change hasn't made it into the 304 release of the VulkanSDK. I'm so sorry about that!
When compiling in Visual Studio (MSVC), the following error is produced:
Commenting out line 2701 of Vulkan.cppm fixes the issue and allows compilation.
The visual studio project was generated with this cmake code:
The text was updated successfully, but these errors were encountered: