opencv x86(32位) windows下vs2019编译相关资料很多,都特别受用。例如
但是,自己编译时候仍遇到一些问题,例如:
-
CMake's 'find_host_package(PythonInterp 2.7)' found wrong Python version
-
Looking for fseeko - not found
-
CMake Error at D:/cmake/share/cmake-3.25/Modules/FindOpenMP.cmake:420 (try_compile)
-
CheckFunctionExists.obj : error LNK2019: 无法解析的外部符号 fseeko,函数 main 中引用了该符号
-
CMake Error at D:/cmake/share/cmake-3.25/Modules/CheckTypeSize.cmake:147 (try_compile)
针对问题1,注释了"D:\opencv460\opencv\sources\CMakeLists.txt"中python相关的编译项(不需要python),如果想要用python库,可以参考https://blog.csdn.net/liubing8609/article/details/105462166
其他问题经尝试未得到预期效果,最终通过降低cmake版本,成功实现编译。对应版本:
-
opencv4.6.0:https://github.com/opencv/opencv/releases/tag/4.6.0
-
cmake3.18.2:https://github.com/Kitware/CMake/releases/tag/v3.18.2
-
vs2019:https://learn.microsoft.com/zh-cn/visualstudio/releases/2019/release-notes
此外,cmake编译时候遇到了下载失败的问题,可参考:https://blog.csdn.net/m0_59025104/article/details/134109081