简体   繁体   English

Visual Studio找不到'vulkan-1.lib'

[英]Visual Studio Not Finding 'vulkan-1.lib'

I read this tutorial to try to set up Vulkan in Visual Studio. 我阅读了本教程,以尝试在Visual Studio中设置Vulkan。 I got to the very end, compiled, and got this: 我走到了尽头,进行了编译,并得到了以下信息:

在此处输入图片说明

A few more screenshots: 其他一些屏幕截图:

在此处输入图片说明

在此处输入图片说明

I'm using version 1.1.114.0 while the tutorial is using 1.1.77.0, which may be at the root of the issue. 我正在使用1.1.114.0版本,而本教程使用的是1.1.77.0,这可能是问题的根源。 However, I have not been able to find another tutorial showing how to set Vulkan up like this. 但是,我无法找到另一个教程来展示如何像这样设置Vulkan。 How do I get Vulkan to work in Visual Studio? 如何使Vulkan在Visual Studio中工作?

I believe you must have missed a step in the tutorial. 我相信您一定错过了本教程中的步骤。 Specifically, look for the text 具体来说,寻找文字

Next, open the editor for library directories under Linker -> General 接下来,在Linker -> General下打开库目录的编辑Linker -> General

in the linked tutorial page. 在链接的教程页面中。

In the linker Input tab, either use a complete path to the Vulkan library (for example C:\\VulkanSDK\\1.1.101.0\\Lib\\vulkan-1.lib ) or in the General tab, add the location of the library (for example C:\\VulkanSDK\\1.1.101.0\\Lib to the Additional Library Directories entry). 在链接器的“ 输入”选项卡中,使用Vulkan库的完整路径(例如C:\\VulkanSDK\\1.1.101.0\\Lib\\vulkan-1.lib ),或在“ 常规”选项卡中添加库的位置(例如C:\\VulkanSDK\\1.1.101.0\\Lib到“ 其他库目录”条目)。

If you can express the values in terms of an environment variable, then you'd want to use either VULKAN_SDK or VK_SDK_PATH , which in the above examples would resolve to C:\\VulkanSDK\\1.1.101.0 . 如果可以用环境变量来表示值,则可以使用VULKAN_SDKVK_SDK_PATH ,在上面的示例中,这些解析为C:\\VulkanSDK\\1.1.101.0 That way when you update your Vulkan SDK you don't need to update your project files, and they'll work on other machines that might have different versions installed. 这样,当您更新Vulkan SDK时,您不需要更新项目文件,它们将在可能安装了不同版本的其他计算机上运行。

In the long run I'd recommend switching to CMake for project generation, rather than maintaining Visual Studio project files directly. 从长远来看,我建议切换到CMake进行项目生成,而不是直接维护Visual Studio项目文件。 With CMake, adding a Vulkan dependency to your application is as easy as doing this: 使用CMake,向您的应用程序添加Vulkan依赖关系很容易:

find_package(Vulkan REQUIRED)
target_link_libraries(MyApp Vulkan::Vulkan)

You can find existing CMake-based Vulkan examples here or here . 您可以在此处此处找到现有的基于CMake的Vulkan示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM