0

The problem is that the compiler refuses to connect the library Vulkan-Headers. I using cmake & GNU for building project.

Cmake:


project(v_l)

add_executable(${PROJECT_NAME} out/main.cpp)

add_subdirectory(Vulkan-Headers)
target_link_libraries(${PROJECT_NAME} PUBLIC Vulkan-Headers)
target_include_directories(${PROJECT_NAME} PUBLIC Vulkan-Headers/include)

main.cpp:

#include <vulkan/vulkan.h>

int main()
{
    VkInstance instance;
    vkDestroyInstance(instance, nullptr);
    return 0;
}

flags for compile: cmd.exe /C "cd . && C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\Llvm\x64\bin\clang.exe -fuse-ld=lld-link -nostartfiles -nostdlib -g -Xclang -gcodeview -O0 -D_DEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd -Xlinker /subsystem:console CMakeFiles/v_l.dir/out/main.cpp.obj -o v_l.exe -Xlinker /MANIFEST:EMBED -Xlinker /implib:v_l.lib -Xlinker /pdb:v_l.pdb -Xlinker /version:0.0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -loldnames && cd ."

arkasha
  • 1
  • 2
  • I don't see anything on the link line that looks like a Vulkan library. – Richard Critten May 16 '22 at 17:47
  • Assuming you want to link the Vulkan loader (which implements `vkDestroyInstance`) statically, that means linking against `vulkan-1.lib` on Windows, which should be available in your Vulkan SDK installation. – James0124 May 16 '22 at 20:23

0 Answers0