OpenCV C++学习1 Cmake+VS 编译 OpenCV

一、下载安装Cmake

https://CMake.org/download/
安装vs

二、下载OpenCV

下载地址:
https://opencv.org/releases/

我这里路径是这样放置的:

在这里插入图片描述

错误处理:
提示:could not find any instance of Visual Studio.
选择file下面的delete cache .

三、执行Cmake

在这里插入图片描述
Configure:
在这里插入图片描述
执行完后,钩选 BUILD_opencv_world(允许把所有的OpenCV模块构建到一个库中),再次点击Configure。

完成后点击Generate

四、vs编译

使用vs打开build目录下的sln文件 , 或点击cmake界面的open project按钮,打开vs。
选择vs菜单: Build-Batch Build,确保Build这一列中 ALL_BUILD和INSTALL处于选中状态,
然后点击Build。等待编译完成。

猜你喜欢

转载自blog.csdn.net/xundh/article/details/105944987