1. 程式人生 > >vcpkg錯誤分析方法

vcpkg錯誤分析方法

使用 all http att 找到 發現 ros ash 信息

最近在使用vcpkg時,經常會碰到CMake錯誤。 有些以前能編譯通過的包, 過一段時間又不能編譯錯誤了。 錯誤提示一般是CMake錯誤, 弄得很郁悶。

我采用以下步驟解決了問題:

  1. 分析錯誤
  2. 查看錯誤日誌
  3. 查看cmake文件
  4. 手工處理錯誤

下面是我opencv編譯錯誤解決過程:

1. 執行vcpkg命令

PS D:\Develop\GitOthers\vcpkg> ./vcpkg install opencv

2. 錯誤信息

CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:43 (message):
......
See logs for
more information: D:\Develop\GitOthers\vcpkg\buildtrees\opencv\config-x64-windows-rel-out.log D:\Develop\GitOthers\vcpkg\buildtrees\opencv\config-x64-windows-rel-err.log Call Stack (most recent call first): scripts/cmake/vcpkg_configure_cmake.cmake:170 (vcpkg_execute_required_process) ports
/opencv/portfile.cmake:36 (vcpkg_configure_cmake) scripts/ports.cmake:72 (include) Error: Building package opencv:x64-windows failed with: BUILD_FAILED Please ensure youre using the latest portfiles with `.\vcpkg update`, then submit an issue at https://github.com/Microsoft/vcpkg/issues including: Package: opencv:x64-windows Vcpkg version:
0.0.81-fd9b73987bf215f1d10acf4207c3cc637a1bcf2c Additionally, attach any relevant sections from the log files above.

3. 查看錯誤日誌(XXX-err.log)

CMake Warning at 3rdparty/ippicv/downloader.cmake:56 (message):
  ICV: Local copy of ICV package has invalid MD5 hash:
  0d1682bf35ca5cd296a7cc795d30ecc8 (expected:
  04e81ce5d0e329c3fbc606ae32cad44d)
Call Stack (most recent call first):
  3rdparty/ippicv/downloader.cmake:110 (_icv_downloader)
  cmake/OpenCVFindIPP.cmake:243 (include)
  cmake/OpenCVFindLibsPerf.cmake:37 (include)
  CMakeLists.txt:564 (include)


CMake Error at 3rdparty/ippicv/downloader.cmake:73 (file):
  file DOWNLOAD HASH mismatch

    for file: [D:/Develop/GitOthers/vcpkg/buildtrees/opencv/src/opencv-3.2.0/3rdparty/ippicv/downloads/windows-04e81ce5d0e329c3fbc606ae32cad44d/ippicv_windows_20151201.zip]
      expected hash: [04e81ce5d0e329c3fbc606ae32cad44d]
        actual hash: [57ed63670f6763ece0d789f9cb52d952]
             status: [28;"Timeout was reached"]

Call Stack (most recent call first):
  3rdparty/ippicv/downloader.cmake:110 (_icv_downloader)
  cmake/OpenCVFindIPP.cmake:243 (include)
  cmake/OpenCVFindLibsPerf.cmake:37 (include)
  CMakeLists.txt:564 (include)


CMake Error at 3rdparty/ippicv/downloader.cmake:77 (message):
  ICV: Failed to download ICV package: ippicv_windows_20151201.zip.
  Status=28;"Timeout was reached"
Call Stack (most recent call first):
  3rdparty/ippicv/downloader.cmake:110 (_icv_downloader)
  cmake/OpenCVFindIPP.cmake:243 (include)
  cmake/OpenCVFindLibsPerf.cmake:37 (include)
  CMakeLists.txt:564 (include)

查看日誌, 發現原來是有個文件下載不完整, 造成了後續操作無法完成。

4. 如何解決問題呢?

查看opencv-3.2.0\3rdparty\ippicv\downloader.cmake文件,找到相應的下載文件,手動下載 ippicv_windows_20151201.zip
下載完成後,將文件復制到
D:/Develop/GitOthers/vcpkg/buildtrees/opencv/src/opencv-3.2.0/3rdparty/ippicv/downloads/windows-04e81ce5d0e329c3fbc606ae32cad44d/ippicv_windows_20151201.zip
然後再次執行vcpkg編譯命令

vcpkg錯誤分析方法