Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'PFN_VoidFunction': is not a member of 'vk' when using vulkan.cppm #527

Open
MonicaLiu0311 opened this issue Feb 10, 2025 · 0 comments
Open

Comments

@MonicaLiu0311
Copy link

See microsoft/vcpkg#43519 for the original issue. Please see the fix at microsoft/vcpkg#43676.

Operating system

Windows

Compiler

MSVC

Steps to reproduce the behavior

Running vcpkg in manifest mode
including vulkan-headers version 1.4.304.0
Build a module out of vulkan.cppm using the following CMakeLists.txt:

find_package(VulkanHeaders CONFIG REQUIRED)
find_package(Vulkan REQUIRED)

add_library(VulkanHppModule)
add_library(Vulkan::cppm ALIAS VulkanHppModule)

set_target_properties(VulkanHppModule
   PROPERTIES
     CXX_STANDARD_REQUIRED ON
     CXX_EXTENSIONS OFF
     CXX_MODULE_STD OFF
)

target_compile_definitions(VulkanHppModule
   PRIVATE
      VULKAN_HPP_NO_SMART_HANDLE
      VULKAN_HPP_NO_CONSTRUCTORS
   PUBLIC
      VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=0
)

target_compile_features(VulkanHppModule
   PUBLIC
     cxx_std_20
)
target_include_directories(VulkanHppModule
   PRIVATE
   "${Vulkan_INCLUDE_DIR}"
)
target_link_libraries(VulkanHppModule
   PRIVATE
      Vulkan::Headers
      Vulkan::Vulkan
)
target_sources(VulkanHppModule
   PUBLIC
      FILE_SET cxx_modules TYPE CXX_MODULES 
      BASE_DIRS
         "${Vulkan_INCLUDE_DIR}"
      FILES
         "${Vulkan_INCLUDE_DIR}/vulkan/vulkan.cppm"
)

Failure logs

[build] <...>\build\VS2022\vcpkg_installed\x64-windows\include\vulkan\vulkan.cppm(2701): error C2039: 'PFN_VoidFunction': is not a member of 'vk'
[build] <...>\build\VS2022\vcpkg_installed\x64-windows\include\vulkan\vulkan.cppm(29): note: see declaration of 'vk'
[build] <...>\build\VS2022\vcpkg_installed\x64-windows\include\vulkan\vulkan.cppm(2701): error C2873: 'PFN_VoidFunction': symbol cannot be used in a using-declaration

Additional context

  • Editing vulkan.cppm at line 2701 and commenting the using statement fixes the problem

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant