我在尝试用VisualGDB交叉编译OpenCV时遇到了这个问题遵循本教程https://visualgdb.com/tutorials/raspberry/opencv/build/
在命令行中键入tar -xf b624b995ec9c439cbc2e9e6ee940d3a2-v0.1.1f.zip
时,我也会遇到同样的错误。
它在CMakeList中的哪个位置使用命令tar.exe
?有没有可能用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()
...
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):
我把问题追溯到cmakeopencvdownload.cmake
,在236号线上
execute_process(COMMAND "${CMAKE_COMMAND}" -E tar xzf "${CACHE_CANDIDATE}"
WORKING_DIRECTORY "${DL_DESTINATION_DIR}"
RESULT_VARIABLE res)
如果我运行相同的命令行,我会得到以下错误:
opencv.cacheade>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行修改文件cmakeopencvdownload.cmake
更改
execute_process(COMMAND "${CMAKE_COMMAND}" -E tar xzf "${CACHE_CANDIDATE}"
至
execute_process(COMMAND 7z x "${CACHE_CANDIDATE}"