天天看點

ubuntu18.04使用vcpkg安裝opencv3遇到的問題

問題如下

vcpkg install opencv3

[email protected]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中所要求的即可

繼續閱讀