Error when excute make
gcc -Isrc/inc -O2 -Wall -DPA_USE_COREAUDIO pkg-config --cflags opencv src/video.c -c -o objs/video.o
In file included from src/video.c:1:
In file included from /usr/local/Cellar/opencv/3.4.0/include/opencv/cv.h:63:
In file included from /usr/local/Cellar/opencv/3.4.0/include/opencv2/core/core_c.h:48:
/usr/local/Cellar/opencv/3.4.0/include/opencv2/core/types_c.h:929:13: warning: implicit declaration of function
'cvRound' is invalid in C99 [-Wimplicit-function-declaration]
ipt.x = cvRound(point.x);
^
src/video.c:18:8: error: unknown type name 'CvCapture'
static CvCapture* cv_cap;
^
src/video.c:52:3: warning: implicit declaration of function 'cvReleaseCapture' is invalid in C99
[-Wimplicit-function-declaration]
cvReleaseCapture( &cv_cap );
^
src/video.c:99:12: warning: implicit declaration of function 'cvCaptureFromCAM' is invalid in C99
[-Wimplicit-function-declaration]
cv_cap = cvCaptureFromCAM(0);
^
src/video.c:107:17: warning: implicit declaration of function 'cvQueryFrame' is invalid in C99
[-Wimplicit-function-declaration]
color_img = cvQueryFrame(cv_cap);
^
4 warnings and 1 error generated.
make: *** [objs/video.o] Error 1
same here.
/usr/local/Cellar/opencv/3.4.1_5/include/opencv2/core/cvdef.h:485:1: error: unknown type name 'namespace'
namespace cv {
^
/usr/local/Cellar/opencv/3.4.1_5/include/opencv2/core/cvdef.h:485:13: error: expected ';' after top level declarator
namespace cv {
^
;
In file included from src/video.c:1:
In file included from /usr/local/Cellar/opencv/3.4.1_5/include/opencv/cv.h:63:
In file included from /usr/local/Cellar/opencv/3.4.1_5/include/opencv2/core/core_c.h:48:
/usr/local/Cellar/opencv/3.4.1_5/include/opencv2/core/types_c.h:513:5: warning: implicit declaration of function '__assert_rtn' is
invalid in C99 [-Wimplicit-function-declaration]
assert( (unsigned)CV_MAT_DEPTH(type) <= CV_64F );
^
/usr/include/assert.h:93:34: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from src/video.c:1:
In file included from /usr/local/Cellar/opencv/3.4.1_5/include/opencv/cv.h:63:
In file included from /usr/local/Cellar/opencv/3.4.1_5/include/opencv2/core/core_c.h:48:
/usr/local/Cellar/opencv/3.4.1_5/include/opencv2/core/types_c.h:929:13: warning: implicit declaration of function 'cvRound' is
invalid in C99 [-Wimplicit-function-declaration]
ipt.x = cvRound(point.x);
^
In file included from src/video.c:2:
In file included from /usr/local/Cellar/opencv/3.4.1_5/include/opencv/highgui.h:46:
/usr/local/Cellar/opencv/3.4.1_5/include/opencv2/highgui/highgui_c.h:139:7: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
CVAPI(cv::Rect)cvGetWindowImageRect(const char* name);
^
/usr/local/Cellar/opencv/3.4.1_5/include/opencv2/highgui/highgui_c.h:139:9: error: expected ';' after top level declarator
CVAPI(cv::Rect)cvGetWindowImageRect(const char* name);
^
;
/usr/local/Cellar/opencv/3.4.1_5/include/opencv2/core/types_c.h:93:49: note: expanded from macro 'CVAPI'
# define CVAPI(rettype) CV_EXTERN_C CV_EXPORTS rettype CV_CDECL
^
In file included from src/video.c:2:
In file included from /usr/local/Cellar/opencv/3.4.1_5/include/opencv/highgui.h:46:
/usr/local/Cellar/opencv/3.4.1_5/include/opencv2/highgui/highgui_c.h:139:10: error: expected identifier or '('
CVAPI(cv::Rect)cvGetWindowImageRect(const char* name);
^
src/video.c:18:8: error: unknown type name 'CvCapture'
static CvCapture* cv_cap;
^
src/video.c:52:3: warning: implicit declaration of function 'cvReleaseCapture' is invalid in C99 [-Wimplicit-function-declaration]
cvReleaseCapture( &cv_cap );
^
src/video.c:99:12: warning: implicit declaration of function 'cvCaptureFromCAM' is invalid in C99 [-Wimplicit-function-declaration]
cv_cap = cvCaptureFromCAM(0);
^
src/video.c:107:17: warning: implicit declaration of function 'cvQueryFrame' is invalid in C99 [-Wimplicit-function-declaration]
color_img = cvQueryFrame(cv_cap);
^
6 warnings and 5 errors generated.
make: *** [objs/video.o] Error 1
I just have issue : src/video.c:18:8: error: unknown type name 'CvCapture'
solved by:
add #include "opencv2/videoio/videoio_c.h" in video.c