Codeblocks - OpenCV 4.2.0 配置

Codeblocks - OpenCV 4.2.0 配置

1. 头文件目录配置

(base) yongqiang@famu-sys:~$ pkg-config --cflags opencv4
-I/usr/local/include/opencv4/opencv -I/usr/local/include/opencv4
(base) yongqiang@famu-sys:~$ 

1.1 Release -> Search directories -> Compiler

Project -> Build options… -> Release -> Search directories -> Compiler

/usr/local/include
/usr/local/include/opencv4
/usr/local/include/opencv4/opencv2

1.2 Debug -> Search directories -> Compiler

Project -> Build options… -> Debug -> Search directories -> Compiler

/usr/local/include
/usr/local/include/opencv4
/usr/local/include/opencv4/opencv2

在这里插入图片描述

2. 库文件目录配置

(base) yongqiang@famu-sys:~$ pkg-config --libs opencv4
-L/usr/local/lib -lopencv_dnn -lopencv_stitching -lopencv_ml -lopencv_photo -lopencv_objdetect -lopencv_gapi -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_calib3d -lopencv_features2d -lopencv_imgproc -lopencv_flann -lopencv_core
(base) yongqiang@famu-sys:~$

1.1 Release -> Search directories -> Linker

Project -> Build options… -> Release -> Search directories -> Linker

/usr/local/lib

1.2 Debug -> Search directories -> Linker

Project -> Build options… -> Debug -> Search directories -> Linker

/usr/local/lib

在这里插入图片描述

3. 链接库文件配置

/usr/local/lib 下 OpenCV 的所有 .so 文件全部加入到 Link libraries 中。

3.1 Release -> Linker settings -> Link libraries

Project -> Build options… -> Release -> Linker settings -> Link libraries

在这里插入图片描述

在这里插入图片描述

3.1 Debug -> Linker settings -> Link libraries

Project -> Build options… -> Debug -> Linker settings -> Link libraries

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

发布了443 篇原创文章 · 获赞 1685 · 访问量 101万+

猜你喜欢

转载自blog.csdn.net/chengyq116/article/details/104321690