ubuntu18.04使用vcpkg安装opencv3遇到的问题

问题如下
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中所要求的即可

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值