I have an OpenCV installation on Ubuntu Linux. From any example the headers are:
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
When I compile with these includes I get the error :
fatal error: opencv2/imgcodecs.hpp: No such file or directory
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
I can find out where OpenCV is located with
pkg-config --cflags --libs opencv
which outputs as follow:
"Package opencv was not found"
When I try pkg-config --cflags --libs opencv2
I get:
"Package opencv2 was not found"
Only when I use pkg-config --cflags --libs opencv4 do I get the path:
-I/usr/local/include/opencv4/opencv2
so I thought that by changing the includes to:
#include <opencv4/imgcodecs.hpp>
#include <opencv4/highgui.hpp>
it would work. But I get:
fatal error: opencv4/imgcodecs.hpp: No such file or directory
#include <opencv4/imgcodecs.hpp>
so when I try the full path:
#include <opencv4/opencv2/imgcodecs.hpp>
I get:
imgcodecs.hpp:46:10: fatal error: opencv2/core.hpp: No such file or directory
#include "opencv2/core.hpp"
and of course in the hpp file in question it is:
#include "opencv2/core.hpp"
Is there a simple way to fix all this?