问题如下
vcpkg install opencv3

book@100ask:~/vcpkg$ vcpkg install opencv3
Computing installation plan...
The following packages will be built and installed:
    opencv3[core,dnn,flann,jpeg,png,quirc,tiff,webp]:x64-linux -> 3.4.13
  * protobuf[core]:x64-linux -> 3.14.0#1
  * quirc[core]:x64-linux -> 1.1#2
  * tiff[core]:x64-linux -> 4.1.0#1
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-linux...
Could not locate cached archive: /home/book/.cache/vcpkg/archives/0f/0fbc038393b6529a961944fa848a83a84033bf48.zip
Could not locate cached archive: /home/book/.cache/vcpkg/archives/66/66e6b718d7039fe91ee2eb871a66be75ee2b444f.zip
Could not locate cached archive: /home/book/.cache/vcpkg/archives/f7/f775f32c5aad0c5d868e493ccb1cbaf98dc109d5.zip
Could not locate cached archive: /home/book/.cache/vcpkg/archives/1f/1ffb0ac04efbcaaea7ee93c1599ae48d33c728e8.zip
Starting package 1/4: protobuf:x64-linux
Building package protobuf[core]:x64-linux...
-- Using cached /home/book/vcpkg/downloads/protocolbuffers-protobuf-2514f0bd7da7e2af1bed4c5d1b84f031c4d12c10.tar.gz
-- Cleaning sources at /home/book/vcpkg/buildtrees/protobuf/src/31c4d12c10-2e3bb0fe91.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source /home/book/vcpkg/downloads/protocolbuffers-protobuf-2514f0bd7da7e2af1bed4c5d1b84f031c4d12c10.tar.gz
-- Applying patch fix-static-build.patch
-- Applying patch fix-default-proto-file-path.patch
-- Using source at /home/book/vcpkg/buildtrees/protobuf/src/31c4d12c10-2e3bb0fe91.clean
CMake Deprecation Warning at scripts/cmake/vcpkg_check_features.cmake:182 (message):
  calling `vcpkg_check_features` without the `FEATURES` keyword has been
  deprecated.

      Please add the `FEATURES` keyword to the call.
Call Stack (most recent call first):
  ports/protobuf/portfile.cmake:36 (vcpkg_check_features)
  scripts/ports.cmake:142 (include)


-- Configuring x64-linux-dbg
-- Configuring x64-linux-rel
-- Building x64-linux-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:146 (message):
    Command failed: /home/book/vcpkg/downloads/tools/cmake-3.19.2-linux/cmake-3.19.2-Linux-x86_64/bin/cmake --build . --config Debug --target install -- -v -j9
    Working Directory: /home/book/vcpkg/buildtrees/protobuf/x64-linux-dbg
    See logs for more information:
      /home/book/vcpkg/buildtrees/protobuf/install-x64-linux-dbg-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_build_cmake.cmake:105 (vcpkg_execute_build_process)
  scripts/cmake/vcpkg_install_cmake.cmake:45 (vcpkg_build_cmake)
  ports/protobuf/portfile.cmake:58 (vcpkg_install_cmake)
  scripts/ports.cmake:142 (include)


Error: Building package protobuf:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `./vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: protobuf:x64-linux
  Vcpkg version: 2021-01-13-unknownhash

解决办法
重新安装gcc g++
1.sudo apt-get autoremove gcc g++
2.sudo apt-get install aptitude
3.sudo aptitude install gcc
4.sudo aptitude install gcc
5.sudo apt-get install build-essential
即可解决

至于下载慢,我都是复制下载链接到迅雷下的,个别时候也用浏览器内置的下载工具
下载的包拷贝到downloads目录,名字修改成shell中所要求的即可

GitHub 加速计划 / vc / vcpkg
22.52 K
6.21 K
下载
vcpkg - 一个用于管理 C 和 C++ 库的工具,支持在 Windows、Linux 和 macOS 上安装和集成各种库。
最近提交(Master分支:1 个月前 )
4f746bc6 8 天前
6e90218d 8 天前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐