DEV Community

SolBeen Kwon
SolBeen Kwon

Posted on

[C++] #include opencv2.xxx.h no such file or directory

  • because /usr/include does not have opencv2 folder or opencv2/xxx.h header file

  • If you installed opencv4, you might have installed the opencv installation path on /usr/local/ during installation.

  • /usr/local/include/opencv4/opencv2 folder can be found to have the xxx.h header file!

20210402_143602

따라서

#include <opencv4/opencv2/xxxx.h>
Enter fullscreen mode Exit fullscreen mode

====================================================
c++ include 기본 경로를 보는 명령어는
echo | gcc -v -x c -E -
echo | gcc -v -x c++ -E -

=================================================
make했을때 경로에러가 난다면 Makefile 에

컴파일시 include 경로를 추가해주면 된다.
20210402_143429

Top comments (0)