How do I tell c++ where opencv2/opencv.hpp is?
By John Campbell •
Note: this is in the context of installing cafe.
At the moment I have openCV installed at:
/home/myName/Documents/my folder/opencv/ However C++ can't find it here, as demonstrated by the fact that any mention of:
#include <opencv2/opencv.hpp>In any C++ source code, results in:
fatal error: opencv2/opencv.hpp: No such file or directoryI tried to solve this by using the following .pc file:
prefix="/home/myName/Documents/my folder/opencv/"
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib
Name: openCV
Description: The openCV library
Version: 3.1.0
Cflags: -I${includedir}/openCV
Libs: -L${libdir} -lopenCVAnd putting it in:
/usr/lib/pkgconfigHowever this had no effect. I also tried modifying the make file of cafe like this:
# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include \ /usr/include/hdf5/serial/ \ "/home/myName/Documents/my folder/opencv/include"
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib \ "/home/myName/Documents/my folder/opencv/lib"This also didn't work. At the moment I am out of ideas. Does anyone know how I can tell C++ where to find openCV?
4 Reset to default