In my Ubuntu 11.04, the headers are in: */usr/include/opencv-2.3.1/* , I assume this should be */usr/include/opencv-2.4.0/* .
You have two solutions:
- When compiling, use the -Ioption:g++ -o [name] [src] -I/usr/include/opencv-2.4.0
- Creating symbolic links to opencv-2.4.0 / opencv and opencv-2.4.0 / opencv2 in / usr / include.
The second solution is useful if you use CMake, because FindOpenCV2 does not look for OpenCV in /usr/include/opencv-2.4.0 . I hope this (ugly) hacking solves your problem.