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

Codeblocks - OpenCV 4.2.0 配置_第1张图片

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

Codeblocks - OpenCV 4.2.0 配置_第2张图片

3. 链接库文件配置

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

3.1 Release -> Linker settings -> Link libraries

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

Codeblocks - OpenCV 4.2.0 配置_第3张图片

Codeblocks - OpenCV 4.2.0 配置_第4张图片

3.1 Debug -> Linker settings -> Link libraries

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

Codeblocks - OpenCV 4.2.0 配置_第5张图片

Codeblocks - OpenCV 4.2.0 配置_第6张图片

Codeblocks - OpenCV 4.2.0 配置_第7张图片

你可能感兴趣的:(OpenCV,2,-,OpenCV,3,-,OpenCV,4,CodeBlocks)