I’m building openCV using the following instructions:
cmake -DWITH_QT=ON -DWITH_OPENGL=ON -DFORCE_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_XINE=ON -DENABLE_PRECOMPILED_HEADERS=OFF -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ..
make -j8
sudo make install
sudo ldconfig
The build is successful, but when running a hello world example:
#include "opencv2/opencv.hpp"
int main() {
cout >> "Hello World";
return 0;
}
and compiling it with
gcc -Iopencv/include helloworld.cpp -o hw.exe
I get the following error:
OpenCV/include/opencv2/opencv.hpp:48:10: fatal error: opencv2/opencv_modules.hpp: No such file or directory
48 | #include "opencv2/opencv_modules.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
My belief is the make commands should be creating an opencv_modules.hpp
file tat lays the paths out to the rest of the dependencies, but this file is not being generated in my case. How can I fix this?