Visual Studio 2019 和 vcpkg 未链接到调试 dll

问题描述 投票:0回答:0

我正在尝试在我的应用程序中使用 protobuf 作为 dll(libprotobuf-lite.dll 和 libprotobuf.dll)。我使用 vcpkg 安装了 protobuf,在 Release 配置中一切正常。但是,如果我在调试配置中构建我的解决方案(使用 Visual Studio),我会收到调试断言错误。我能够将其追踪到所使用的 protobuf dll 的问题。

如果我编译解决方案,Visual Studio(或 vcpkg)会将必要的 dll 从 vcpkg 文件夹复制到解决方案文件夹。正如我所说,这对 Release 非常有效。但是,在调试中,它复制相同的 dll 而不是调试 dll(libprotobufd.dll 和 libprotobuf-lited.dll)。

所以我的问题是:如何配置 vcpkg 和 Visual Studio 2019 以使其使用正确的 dll?

visual-studio dll protocol-buffers vcpkg
© www.soinside.com 2019 - 2024. All rights reserved.