链接错误cxx:找不到-lvulkan

时间:2018-02-17 20:13:37

标签: c++ ubuntu linker-errors vulkan

当我尝试从Anvil框架为Vulkan编译示例时,我得到以下错误:

[ 97%] Linking CXX executable OutOfOrderRasterization /usr/bin/ld: cannot find -lvulkan collect2: error: ld returned 1 exit status CMakeFiles/OutOfOrderRasterization.dir/build.make:126: recipe for target 'OutOfOrderRasterization' failed make[2]: *** [OutOfOrderRasterization] Error 1 CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/OutOfOrderRasterization.dir/all' failed make[1]: *** [CMakeFiles/OutOfOrderRasterization.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

我如何配置Vulkan来解决它? (Ubuntu的)

2 个答案:

答案 0 :(得分:1)

检查LIBRARY路径。您可能需要下载并安装vulkan。您的库路径(.so/usr/lib{,64}/lib{,64})中应该有一个/usr/share/lib{,64}文件,其名称为libvulkan.numbers.so。

请参阅此问ubuntu问题:https://askubuntu.com/questions/796442/ld-cannot-find-lvulkan

答案 1 :(得分:0)

CMake版本3.7及更高版本随附FindVulkan.cmake模块,如果您安装了Vulkan SDK且设置了VULKAN_SDK环境变量,则会为您找到Vulkan包含和库。如果已将Vulkan软件包安装到系统目录,CMake模块还会查找包含和库。 LunarXchange网站上的Getting Started guide有一些额外的细节。