简体   繁体   中英

libgit2 dependency pcre not present in build

I'm building a C++ app which uses the libgit2 library to interact with a git repo. I've installed libgit2 through vcpkg, which also installed the pcre library which libgit2 needs. 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. This is correct, pcre.dll isn't in my output folder as none of my code has any interaction with it. Libgit2 needs it.

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. The git2.dll does get included with the build. The paths that need to be added to Visual Studio are there, managed by vcpkg. Everything is setup so that pcre could be included in a build if need be.

I use libgit2 v 1.1.0, Visual Studio 2019 and the latest stable version of vcpkg.

I'm running into the same issue and have opened a 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. For now, you're welcome to use my vcpkg fork which exposes the "builtin" REGEX_BACKEND CMake option, which works around this problem. https://github.com/motevets/vcpkg/tree/fix-libgit2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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