简体   繁体   English

构建中不存在libgit2依赖pcre

[英]libgit2 dependency pcre not present in build

I'm building a C++ app which uses the libgit2 library to interact with a git repo.我正在构建一个 C++ 应用程序,它使用 libgit2 库与 git 存储库进行交互。 I've installed libgit2 through vcpkg, which also installed the pcre library which libgit2 needs.我已经通过vcpkg安装了libgit2,它还安装了libgit2需要的pcre库。 So far, so good.到目前为止,一切都很好。 When I build my project there is no issue, only when I launch the app it throws an error that pcre.dll is not present.当我构建我的项目时没有问题,只有当我启动应用程序时,它才会抛出 pcre.dll 不存在的错误。 This is correct, pcre.dll isn't in my output folder as none of my code has any interaction with it.这是正确的,pcre.dll 不在我的 output 文件夹中,因为我的代码都没有与之交互。 Libgit2 needs it. Libgit2 需要它。

How can I get the dependency of the dependency to be included in my final build?如何让依赖项的依赖项包含在我的最终构建中?

Pcre is present and accounted for, but none of my code uses it so it doesn't get included in the build of my app. Pcre 存在并占,但我的代码都没有使用它,因此它不会包含在我的应用程序的构建中。 The git2.dll does get included with the build. git2.dll 确实包含在构建中。 The paths that need to be added to Visual Studio are there, managed by vcpkg.需要添加到 Visual Studio 的路径在那里,由 vcpkg 管理。 Everything is setup so that pcre could be included in a build if need be.一切都已设置好,因此如果需要,pcre 可以包含在构建中。

I use libgit2 v 1.1.0, Visual Studio 2019 and the latest stable version of vcpkg.我使用 libgit2 v 1.1.0、Visual Studio 2019 和最新的稳定版 vcpkg。

I'm running into the same issue and have opened a PR: https://github.com/microsoft/vcpkg/pull/18289我遇到了同样的问题并打开了一个 PR: https://github.com/microsoft/vcpkg/pull/18289

Based on Neumann-A's feedback in the PR, it looks like there may be a bug preventing the pcre DLL from getting copied to the release/deployment files.根据 Neumann-A 在 PR 中的反馈,看起来可能存在阻止 pcre DLL 复制到发布/部署文件的错误。 For now, you're welcome to use my vcpkg fork which exposes the "builtin" REGEX_BACKEND CMake option, which works around this problem.现在,欢迎您使用我的 vcpkg fork,它公开了“内置” REGEX_BACKEND CMake 选项,它可以解决这个问题。 https://github.com/motevets/vcpkg/tree/fix-libgit2 https://github.com/motevets/vcpkg/tree/fix-libgit2

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

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