CMake错误:archive_write_finish_entry()存在问题:无法恢复时间

时间:2020-04-28 19:31:15

标签: cmake visualgdb

当尝试与VisualGDB交叉编译OpenCV时出现此问题 遵循本教程https://visualgdb.com/tutorials/raspberry/opencv/build/

从命令行键入tar -xf b624b995ec9c439cbc2e9e6ee940d3a2-v0.1.1f.zip时,我也会遇到相同的错误。

使用命令tar.exe在CMakeList中的什么位置?是否可以将其替换为不会出错的东西,例如7zip?还是可以通过更新tar来解决?

即使以管理员身份,我也无法从C:\ windows \ System32中删除或替换tar.exe

是否有解决此问题的方法?

网上闲逛,tar甚至不支持zip文件,为什么要尝试解压缩zip文件?

谢谢

Performing Test HAVE_CXX_WNO_ENUM_COMPARE_SWITCH
Performing Test HAVE_CXX_WNO_ENUM_COMPARE_SWITCH - Failed
Performing Test HAVE_CXX_WNO_SUGGEST_OVERRIDE
Performing Test HAVE_CXX_WNO_SUGGEST_OVERRIDE - Success
Performing Test HAVE_CXX_WNO_INCONSISTENT_MISSING_OVERRIDE
Performing Test HAVE_CXX_WNO_INCONSISTENT_MISSING_OVERRIDE - Failed
Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH
Performing Test HAVE_CXX_WNO_IMPLICIT_FALLTHROUGH - Success
Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS
Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS - Success
Performing Test HAVE_CXX_WNO_CLASS_MEMACCESS
Performing Test HAVE_CXX_WNO_CLASS_MEMACCESS - Success
ADE: Download: v0.1.1f.zip
CMake Error: Problem with archive_write_finish_entry(): Can't restore time
CMake Error: Problem extracting tar: E:/Projects/temp/OpenCV/opencv/.cache/ade/b624b995ec9c439cbc2e9e6ee940d3a2-v0.1.1f.zip
CMake Error at cmake/OpenCVDownload.cmake:240 (message):
  ADE: Unpack failed: 1
Call Stack (most recent call first):
  modules/gapi/cmake/DownloadADE.cmake:5 (ocv_download)
  modules/gapi/cmake/init.cmake:19 (include)
  cmake/OpenCVModule.cmake:312 (include)
  cmake/OpenCVModule.cmake:375 (_add_modules_1)
  modules/CMakeLists.txt:7 (ocv_glob_modules)

Configuring incomplete, errors occurred!
See also "E:/Projects/temp/OpenCV/opencv/VisualGDB/Debug/CMakeFiles/CMakeOutput.log".
See also "E:/Projects/temp/OpenCV/opencv/VisualGDB/Debug/CMakeFiles/CMakeError.log".
CMake Deprecation Warning:
  The 'cmake-server(7)' is deprecated.  Please port clients to use the
  'cmake-file-api(7)' instead.

Exception reported by CMake server: Configuration failed.
wh1+x: Exception reported by CMake server: Configuration failed.
   at wh1.c2[_InType,_OutType](_InType a)
   at g61.x(String[] a)
   at g61.l_2(Hello a)
   at wh1.m1()

1 个答案:

答案 0 :(得分:1)

...
Performing Test HAVE_CXX_WNO_CLASS_MEMACCESS - Success
ADE: Download: v0.1.1f.zip
CMake Error: Problem with archive_write_finish_entry(): Can't restore time
CMake Error: Problem extracting tar: E:/Projects/opencv/.cache/ade/b624b995ec9c439cbc2e9e6ee940d3a2-v0.1.1f.zip
CMake Error at cmake/OpenCVDownload.cmake:240 (message):

我将问题追溯到cmake\opencvdownload.cmake,在第236行

execute_process(COMMAND "${CMAKE_COMMAND}" -E tar xzf "${CACHE_CANDIDATE}" WORKING_DIRECTORY "${DL_DESTINATION_DIR}" RESULT_VARIABLE res)

如果我在同一命令行上运行,则会出现此错误:

opencv\.cache\ade>cmake -E tar xzf b624b995ec9c439cbc2e9e6ee940d3a2-v0.1.1f.zip
CMake Error: Problem with archive_write_finish_entry(): Can't restore time
CMake Error: Problem extracting tar: b624b995ec9c439cbc2e9e6ee940d3a2-v0.1.1f.zip

如果我将其替换为7zip,它可以正常工作 7z x b624b995ec9c439cbc2e9e6ee940d3a2-v0.1.1f.zip

但是,CMake不允许我从命令行执行7zip命令 使用“ Cmake -E ...”

因此是临时解决方案,直到他们在OpenCV或Cmake中解决此问题为止

在第236行修改文件cmake\opencvdownload.cmake 改变

execute_process(COMMAND "${CMAKE_COMMAND}" -E tar xzf "${CACHE_CANDIDATE}"

execute_process(COMMAND 7z x "${CACHE_CANDIDATE}"