3

I am trying to install POCO libraries for C++ through vcpkg, through this command in Windows PowerShell :

.\vcpkg install poco:x64-windows

And I am getting this error :

Error: Building package pcre:x64-windows failed with: BUILD_FAILED

What should I do?

(This is the full command's output)

The following packages will be built and installed:
  * pcre[core]:x64-windows -> 8.45
    poco[core]:x64-windows -> 1.11.0
  * vcpkg-cmake[core]:x64-windows -> 2021-09-13
  * vcpkg-cmake-config[core]:x64-windows -> 2021-09-27
  * zlib[core]:x64-windows -> 1.2.11#13
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
Restored 0 packages from C:\Users\AB\AppData\Local\vcpkg\archives in 244.5 us. Use --debug to see more details.
Starting package 1/5: pcre:x64-windows
Building package pcre[core]:x64-windows...
CMake Warning at scripts/cmake/vcpkg_download_distfile.cmake:170 (message):
  SILENT_EXIT has been deprecated as an argument to vcpkg_download_distfile
  -- remove the argument to resolve this warning
Call Stack (most recent call first):
  ports/pcre/portfile.cmake:12 (vcpkg_download_distfile)
  scripts/ports.cmake:142 (include)


-- Downloading https://ftp.pcre.org/pub/pcre/pcre-8.45.zip -> pcre-8.45.zip...
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'manifests' = off
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] Downloading https://ftp.pcre.org/pub/pcre/pcre-8.45.zip
[DEBUG] Download failed -- retrying after 1000 ms.
[DEBUG] Download failed -- retrying after 2000 ms.
[DEBUG] Download failed -- retrying after 4000 ms.
[DEBUG] D:\a\_work\1\s\src\vcpkg\base\downloads.cpp(656)
Error: Failed to download from mirror set:
https://ftp.pcre.org/pub/pcre/pcre-8.45.zip: WinHttpSendRequest() failed: 12002
https://ftp.pcre.org/pub/pcre/pcre-8.45.zip: WinHttpSendRequest() failed: 12002
https://ftp.pcre.org/pub/pcre/pcre-8.45.zip: WinHttpSendRequest() failed: 12002
https://ftp.pcre.org/pub/pcre/pcre-8.45.zip: WinHttpSendRequest() failed: 12002

[DEBUG] Exiting after %s (%d us)


CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:84 (message):

      Failed to download file with error: 1
      If you use a proxy, please check your proxy setting. Possible causes are:

      1. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable
         to `https://address:port`. This is not correct, because `https://` prefix
         claims the proxy is an HTTPS proxy, while your proxy (v2ray, shadowsocksr
         , etc..) is an HTTP proxy. Try setting `http://address:port` to both
         HTTP_PROXY and HTTPS_PROXY instead.

      2. You are using Fiddler. Currently a bug (https://github.com/microsoft/vcpkg/issues/17752)
         will set HTTPS_PROXY to `https://fiddler_address:port` which lead to problem 1 above.
         Workaround is open Windows 10 Settings App, and search for Proxy Configuration page,
         Change `http=address:port;https=address:port` to `address`, and fill the port number.

      3. You proxy's remote server is out of service.

      In future vcpkg releases, if you are using Windows, you no longer need to set
      HTTP(S)_PROXY environment variables. Vcpkg will simply apply Windows IE Proxy
      Settings set by your proxy software. See (https://github.com/microsoft/vcpkg-tool/pull/49)
      and (https://github.com/microsoft/vcpkg-tool/pull/77)

      Otherwise, please submit an issue at https://github.com/Microsoft/vcpkg/issues

Call Stack (most recent call first):
  scripts/cmake/vcpkg_download_distfile.cmake:292 (z_vcpkg_download_distfile_show_proxy_and_fail)
  ports/pcre/portfile.cmake:12 (vcpkg_download_distfile)
  scripts/ports.cmake:142 (include)


Error: Building package pcre:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `git pull` and `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  package: pcre[core]:x64-windows -> 8.45
  vcpkg version: 2021-11-02-af04ebf6274fd6f7a941bff4662b3955c64f6f42
  vcpkg-tool version: 3730cbe99 2021-11-08 (49 minutes ago)

Additionally, attach any relevant sections from the log files above.```
X Y
  • 233
  • 1
  • 8

1 Answers1

0

Sometimes, vcpkg can not download some package files from the internet by itself, this is a common problem. When you have a problem like this, backtrack the vcpkg log, find the first error reported, if the error is a download error, backtrack, look for the Downloading log, you can find a log look like this:

- Downloading website -> package_name...

to solve this problem, you can download the package from the website manually, if the name of the package is not the package_name, rename the package name to the package_name, copy the package to this location: VCPKG_ROOT/vcpkg/downloads/, then run the install command again, the vcpkg will use the package file from the download folder directly rather than download it from the internet by itself.

From your log you can find that the first error is Error: Failed to download from mirror set:, this is a download error. The vcpkg can not download the pcre-8.45.zip from https://ftp.pcre.org/pub/pcre/pcre-8.45.zip. You can download the pcre-8.45.zip from https://ftp.pcre.org/pub/pcre/pcre-8.45.zip manually, then rename the file to pcre-8.45.zip and copy it into VCPKG_ROOT/vcpkg/downloads/ folder. Then run the install command again.

Tom
  • 177
  • 7