I'm a beginner in using OpenCV and I get this error when I try to compile my main.cpp-file (among many other errors):
I do not know what I'm doing wrong here. I downloaded OpenCV 2.4.13 zip-file, extracted it into my project folder (see the image) and included the cv.h-file into my main.cpp. What do I need to do? What causes this problem?
I'm using Ubuntu 14.04 LTS, Codeblocks 13.12.
答案 0 :(得分:1)
According to the error messages, you are mixing the local OpenCV instance headers (/home/jjepoh/Document/codeblocks_workspace/opencv/opencv-2.4.13/include/opencv
) with the system-wide instance (/usr/local/include/opencv2/
).
The system-wide instance is probably a different version, and because the local instance most likely uses "#include <opencv/xxx.h>
" for inclusion of dependent headers, the system-wide location is selected in preference. So at the end you get a mixture of two different versions of OpenCV, which apparently doesn't work.
There are basically two (or three) possibilities to fix: