I recommend to link the following libraries:
opencv_core
opencv_highgui
opencv_imgproc
opencv_imgcodecs
And in the .cpp file, you can include like this
#include
#include
#include
#include
using namespace std;
using namespace cv;
Or
#include
#include
using namespace std;
using namespace cv;