I tried to run a c++ program by using Kinect and openCV library in my codeblocks. Everything else seems fine expect for I always get a error said:
/home/maoyi/Documents/practice/practice2.cpp:10:16: fatal error: cv.h: No such file or directory compilation terminated.
Can anyone tell me that what exactly does it mean by saying no such file or directory there? Coz I am very sure that I have a practice2.cpp file there and I installed 46% of OpenCV Library though. I followed the instructions about how to install a OpenCV2.1.0 tutorial from:
http://www.samontab.com/web/2010/04/installing-opencv-2-1-in-ubuntu/
I met problems at the "CMAKE ." step and got some hints like this:
-- Detected version of GNU GCC: 46 (406) -- checking for module 'gstreamer-base-0.10' -- package 'gstreamer-base-0.10' not found -- checking for module 'gstreamer-app-0.10' -- package 'gstreamer-app-0.10' not found -- checking for module 'gstreamer-video-0.10' -- package 'gstreamer-video-0.10' not found -- checking for module 'libdc1394-2' -- package 'libdc1394-2' not found -- checking for module 'libdc1394' -- package 'libdc1394' not found -- checking for module 'libv4l1' -- package 'libv4l1' not found -- Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) Traceback (most recent call last): File "", line 1, in ImportError: No module named numpy.distutils -- IPP detected: -- Parsing 'cvconfig.h.cmake'
And I also tried to open my synaptic package manager to install all those missing modules manually however I even could not find some of them. (For example gstream-app-0.10) ... So I have no idea if this could cause the "no such a file or diretory" error or something. I am very new to OpenCV so don't be surprised if the problem is very stupid.. But anyway I continued the next "make" step and got more desperate hint below. The installation stopped right at 46% and I am mentioned with tons of errors... So I hope someone can take a look into it and maybe can hint me with some solutions. Thanks a lot!
[ 45%] Built target opencv_lapack [ 45%] Building CXX object src/cxcore/CMakeFiles/cxcore_pch_dephelp.dir/cxcore_pch_dephelp.o In file included from /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxcore.h:1826:0, from /home/maoyihuang/Downloads/OpenCV-2.1.0/src/cxcore/_cxcore.h:51, from /home/maoyihuang/Downloads/OpenCV-2.1.0/src/cxcore/cxcore_pch_dephelp.cxx:1: /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxcore.hpp:177:13: error: ‘ptrdiff_t’ does not name a type In file included from /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxcore.hpp:2307:0, from /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxcore.h:1826, from /home/maoyihuang/Downloads/OpenCV-2.1.0/src/cxcore/_cxcore.h:51, from /home/maoyihuang/Downloads/OpenCV-2.1.0/src/cxcore/cxcore_pch_dephelp.cxx:1: /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxoperations.hpp:2043:15: error: ‘ptrdiff_t’ does not name a type /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxoperations.hpp:2591:31: error: ‘ptrdiff_t’ does not name a type In file included from /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxcore.hpp:2308:0, from /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxcore.h:1826, from /home/maoyihuang/Downloads/OpenCV-2.1.0/src/cxcore/_cxcore.h:51, from /home/maoyihuang/Downloads/OpenCV-2.1.0/src/cxcore/cxcore_pch_dephelp.cxx:1: /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxmat.hpp: In member function ‘void cv::Mat::locateROI(cv::Size&, cv::Point&) const’: /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxmat.hpp:387:5: error: ‘ptrdiff_t’ was not declared in this scope /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxmat.hpp:387:5: note: suggested alternatives: /usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:156:28: note: ‘std::ptrdiff_t’ /usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:156:28: note: ‘std::ptrdiff_t’ /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxmat.hpp:387:15: error: expected ‘;’ before ‘delta1’ /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxmat.hpp:389:9: error: ‘delta1’ was not declared in this scope /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxmat.hpp:398:31: error: ‘delta2’ was not declared in this scope /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxmat.hpp: In member function ‘cv::Point cv::MatConstIterator_<_Tp>::pos() const’: /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxmat.hpp:3459:9: error: ‘ptrdiff_t’ was not declared in this scope /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxmat.hpp:3459:9: note: suggested alternatives: /usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:156:28: note: ‘std::ptrdiff_t’ /usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:156:28: note: ‘std::ptrdiff_t’ /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxmat.hpp:3459:19: error: expected ‘;’ before ‘ofs’ /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxmat.hpp:3460:23: error: ‘ofs’ was not declared in this scope /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxmat.hpp:3460:66: error: expected ‘)’ before ‘y’ /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxmat.hpp:3465:9: error: ‘ptrdiff_t’ was not declared in this scope /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxmat.hpp:3465:9: note: suggested alternatives: /usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:156:28: note: ‘std::ptrdiff_t’ /usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:156:28: note: ‘std::ptrdiff_t’ /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxmat.hpp:3465:19: error: expected ‘;’ before ‘ofs’ /home/maoyihuang/Downloads/OpenCV-2.1.0/include/opencv/cxmat.hpp:3466:23: error: ‘ofs’ was not declared in this scope make[2]: * [src/cxcore/CMakeFiles/cxcore_pch_dephelp.dir/cxcore_pch_dephelp.o] Error 1 make[1]: * [src/cxcore/CMakeFiles/cxcore_pch_dephelp.dir/all] Error 2 make: * [all] Error 2