logo       

compilation error with cv.h: msg#01214

lib.opencv

Subject: compilation error with cv.h

Dear All,

I am a newbie in OpenCV.
I compiled a simple program as follow to test with OpenCV but it gives me so
many errors on cv.h. The error shown after the mini program. I was using OpenCV
4beta. Is the cv.h provided by opencv 4 beta valid to be used? Can some one
tell me why and how to solve this problem? I really appreciate your help!


/* usage: prog <image_name> */
#include "cv.h"
#include "highgui.h"
int main( int argc, char** argv )
{
IplImage* img;
if( argc == 2 && (img = cvLoadImage( argv[1], 1)) != 0 )
{
cvNamedWindow( "Image view", 1 );
cvShowImage( "Image view", img );
cvWaitKey(0); // very important
cvDestroyWindow( "Image view" );
cvReleaseImage( &img );
return 0;
}
return -1;
}
-------------------Configuration: Morphology - Win32 Debug--------------------
Compiling...
file.c
c:\program files\opencv\cv\include\cvtypes.h(66) : error C2011:
'CvLineIterator' : 'struct' type redefinition
c:\program files\opencv\cv\include\cv.h(307) : warning C4030: first formal
parameter list longer than the second list
c:\program files\opencv\cv\include\cv.h(317) : warning C4005:
'CV_NEXT_LINE_POINT' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\cxcore.h(1278) :
see previous definition of 'CV_NEXT_LINE_POINT'
c:\program files\opencv\cv\include\cv.h(1055) : error C2143: syntax error :
missing ')' before '*'
c:\program files\opencv\cv\include\cv.h(1055) : error C2081: 'CvPoint2D64d' :
name in formal parameter list illegal
c:\program files\opencv\cv\include\cv.h(1055) : error C2143: syntax error :
missing '{' before '*'
c:\program files\opencv\cv\include\cv.h(1056) : error C2143: syntax error :
missing ';' before '*'
c:\program files\opencv\cv\include\cv.h(1057) : error C2040: 'CvVect64d' : 'int
' differs in levels of indirection from 'double *'
c:\program files\opencv\cv\include\cv.h(1057) : error C2146: syntax error :
missing ';' before identifier 'distortion_coeffs'
c:\program files\opencv\cv\include\cv.h(1058) : error C2059: syntax error :
'type'
c:\program files\opencv\cv\include\cv.h(1061) : error C2059: syntax error : ')'
c:\program files\opencv\cv\include\cv.h(1078) : error C2143: syntax error :
missing ')' before '*'
c:\program files\opencv\cv\include\cv.h(1078) : error C2081: 'CvPoint2D64d' :
name in formal parameter list illegal
c:\program files\opencv\cv\include\cv.h(1078) : error C2143: syntax error :
missing '{' before '*'
c:\program files\opencv\cv\include\cv.h(1079) : error C2143: syntax error :
missing ';' before '*'
c:\program files\opencv\cv\include\cv.h(1080) : error C2040: 'CvVect64d' : 'int
' differs in levels of indirection from 'double *'
c:\program files\opencv\cv\include\cv.h(1080) : error C2146: syntax error :
missing ';' before identifier 'focal_length'
c:\program files\opencv\cv\include\cv.h(1081) : error C2146: syntax error :
missing ';' before identifier 'principal_point'
c:\program files\opencv\cv\include\cv.h(1082) : error C2059: syntax error :
'type'
c:\program files\opencv\cv\include\cv.h(1084) : error C2059: syntax error : ')'
c:\program files\opencv\cv\include\cv.h(1097) : error C2143: syntax error :
missing ')' before '*'
c:\program files\opencv\cv\include\cv.h(1097) : error C2081: 'CvPoint3D64d' :
name in formal parameter list illegal
c:\program files\opencv\cv\include\cv.h(1097) : error C2143: syntax error :
missing '{' before '*'
c:\program files\opencv\cv\include\cv.h(1098) : error C2040: 'CvVect64d' : 'int
' differs in levels of indirection from 'double *'
c:\program files\opencv\cv\include\cv.h(1098) : error C2146: syntax error :
missing ';' before identifier 'rotation_vector'
c:\program files\opencv\cv\include\cv.h(1099) : error C2059: syntax error :
'type'
c:\program files\opencv\cv\include\cv.h(1108) : error C2059: syntax error : ')'
c:\program files\opencv\cv\include\cv.h(1112) : error C2143: syntax error :
missing ')' before '*'
c:\program files\opencv\cv\include\cv.h(1112) : error C2081: 'CvPoint3D64d' :
name in formal parameter list illegal
c:\program files\opencv\cv\include\cv.h(1112) : error C2143: syntax error :
missing '{' before '*'
c:\program files\opencv\cv\include\cv.h(1113) : error C2040: 'CvVect64d' : 'int
' differs in levels of indirection from 'double *'
c:\program files\opencv\cv\include\cv.h(1113) : error C2146: syntax error :
missing ';' before identifier 'rotation_matrix'
c:\program files\opencv\cv\include\cv.h(1114) : error C2059: syntax error :
'type'
c:\program files\opencv\cv\include\cv.h(1117) : error C2059: syntax error : ')'
c:\program files\opencv\cv\include\cv.h(1146) : warning C4028: formal parameter
1 different from declaration
Error executing cl.exe.
file.obj - 32 error(s), 3 warning(s)


Thanks.


Fiona


---------------------------------
New Yahoo! Messenger with Voice. Call regular phones from your PC for low, low
rates.

[Non-text portions of this message have been removed]






Change settings: http://www.yahoogroups.com/mygroups, select
Get Emails (get all posts)
Daily Digest (one summary email per day)
Read on the web (read posts on the web only)Or Unsubscribe by mailing
OpenCV-unsubscribe@xxxxxxxxxxxxxxx



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise