diff -u modules/highgui/src/cap.cpp modules/highgui/src.mod/cap.cpp --- modules/highgui/src/cap.cpp 2011-05-10 09:15:45.978453001 +0900 +++ modules/highgui/src.mod/cap.cpp 2011-05-10 09:25:04.406453002 +0900 @@ -171,7 +171,7 @@ if (capture) return capture; #endif - #if defined (HAVE_CAMV4L) || defined (HAVE_CAMV4L2) + #if defined (HAVE_CAMV4L) && defined (HAVE_CAMV4L2) capture = cvCreateCameraCapture_V4L (index); if (capture) return capture; diff -u modules/highgui/src/cap_libv4l.cpp modules/highgui/src.mod/cap_libv4l.cpp --- modules/highgui/src/cap_libv4l.cpp 2011-05-10 09:15:45.970453003 +0900 +++ modules/highgui/src.mod/cap_libv4l.cpp 2011-05-10 09:25:04.394453003 +0900 @@ -241,7 +241,12 @@ #include #include +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) +#include +#else #include +#endif #include #include diff -u modules/highgui/src/cap_v4l.cpp modules/highgui/src.mod/cap_v4l.cpp --- modules/highgui/src/cap_v4l.cpp 2011-05-10 09:15:45.978453001 +0900 +++ modules/highgui/src.mod/cap_v4l.cpp 2011-05-10 09:25:04.406453002 +0900 @@ -202,7 +202,7 @@ #include "precomp.hpp" -#if !defined WIN32 && (defined HAVE_CAMV4L || defined HAVE_CAMV4L2) +#if !defined WIN32 && defined HAVE_CAMV4L && defined HAVE_CAMV4L2 #define CLEAR(x) memset (&(x), 0, sizeof (x)) @@ -214,7 +214,12 @@ #include #include +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) +#include +#else #include +#endif #include #include Common subdirectories: modules/highgui/src/files_Qt and modules/highgui/src.mod/files_Qt