OpenCV踩坑记录

花了两天时间解决用cmake通过vs2019编译OpenCV源码。我的OpenCV版本是4.6,cmake版本是3.25给我报的错误是

Cannot copy output executable

''
to destination specified by COPY_FILE:

'D:/OpenCV/opencvbuild/CMakeFiles/FindOpenMP/ompver_C.bin'
Recorded try_compile output location doesn't exist:

D:/OpenCV/opencvbuild/CMakeFiles/CMakeScratch/TryCompile-im56o0/Debug/cmTC_7b975.exe
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.25/Modules/FindOpenMP.cmake:560 (_OPENMP_GET_SPEC_DATE)
C:/Program Files/CMake/share/cmake-3.25/Modules/FindBLAS.cmake:768 (find_package)
C:/Program Files/CMake/share/cmake-3.25/Modules/FindLAPACK.cmake:247 (find_package)
C:/Program Files/CMake/share/cmake-3.25/Modules/FindLAPACK.cmake:283 (_lapack_find_dependency)
cmake/OpenCVFindLAPACK.cmake:176 (find_package)
CMakeLists.txt:733 (include)

根据错误信息那个文件不存在就找那个文件也找不到,最后不知道真么样在stackoverflow找到一个问答说是cmake版本问题,换成3.24就好。一试果然如此,一换就好。

你可能感兴趣的:(OpenCV,opencv,计算机视觉,人工智能)