So, I just installed OpenCV on my computer, and I'm trying to do a quick test so that everything works. My computer runs Linux Deepin 15. It makes the problem a little difficult to solve, because it is not a well-known popular distribution.
Anyway, here is the code I'm trying to run:
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
using namespace cv;
int main(int argc, const char** argv) {
Mat color = imread("lena.jpg");
Mat gray = imread("lena.jpg", 0);
imwrite("lenaGray.jpg", gray);
return 0;
}
I will compile this using the following command in the terminal:
g++ main.cpp -o main `pkg-config opencv --cflags --libs`
It compiles, apparently, without errors. Creates a “main” file, although the icon in the file manager is not an executable file.
When I try to run it, I get this error:
./main: error while loading shared libraries: libopencv_shape.so.3.1: cannot open shared object file: No such file or directory
I have no idea what to do. I really need to run opencv. I looked on the Internet and couldn’t find anything, even referring to the libopencv_shape.so.3.1 file.
?
!