fatal error: opencv2/opencv.hpp: No such file or directory

1. Specific questions

fatal error: opencv2/opencv.hpp: No such file or directory #include <opencv2/opencv.hpp>

2. Solution

This is because there is an additional opencv4 folder in the path of the opencv header file: /usr/include/opencv4/opencv2

You can link the opencv2 folder to the include folder

sudo ln -s /usr/include/opencv4/opencv2 /usr/include/

Guess you like

Origin blog.csdn.net/weixin_37950717/article/details/125221825