Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when I try to compile #4

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 5 comments
Open

Error when I try to compile #4

GoogleCodeExporter opened this issue Mar 14, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

My OS: Ubuntu 10.10
My version of OpenCV: 2.1

Steps
1) I downloaded facetrack20090316.zip,
2) I tried to compile --by running make-- and I get the below errors.

In file included from ./opencvx/cvxmat.h:32,
                 from ./facetrack.cpp:47:
./opencvx/cvprintmat.h: In function ‘void cvPrintMat(const CvArr*, bool)’:
./opencvx/cvprintmat.h:77: error: ‘__BEGIN__’ was not declared in this scope
./opencvx/cvprintmat.h:116: error: ‘__END__’ was not declared in this scope
./opencvx/cvprintmat.h:86: error: label ‘exit’ used but not defined
In file included from ./opencvx/cvxmat.h:33,
                 from ./facetrack.cpp:47:
./opencvx/cvsetrow.h: In function ‘void cvSetRows(const CvArr*, CvArr*, int, 
int, int)’:
./opencvx/cvsetrow.h:64: error: ‘__BEGIN__’ was not declared in this scope
./opencvx/cvsetrow.h:87: error: ‘__END__’ was not declared in this scope
./opencvx/cvsetrow.h:67: error: label ‘exit’ used but not defined
In file included from ./opencvx/cvxmat.h:34,
                 from ./facetrack.cpp:47:
./opencvx/cvsetcol.h: In function ‘void cvSetCols(const CvArr*, CvArr*, int, 
int)’:
./opencvx/cvsetcol.h:61: error: ‘__BEGIN__’ was not declared in this scope
./opencvx/cvsetcol.h:84: error: ‘__END__’ was not declared in this scope
./opencvx/cvsetcol.h:64: error: label ‘exit’ used but not defined
In file included from ./opencvx/cvxmat.h:35,
                 from ./facetrack.cpp:47:
./opencvx/cvcat.h: In function ‘void cvCat(const CvArr*, const CvArr*, 
CvArr*, int)’:
./opencvx/cvcat.h:81: error: ‘__BEGIN__’ was not declared in this scope
./opencvx/cvcat.h:137: error: ‘__END__’ was not declared in this scope
./opencvx/cvcat.h:85: error: label ‘exit’ used but not defined
In file included from ./opencvx/cvxrectangle.h:38,
                 from ./facetrack.cpp:48:
./opencvx/cvcreateaffine.h: In function ‘void cvCreateAffine(CvMat*, 
CvRect32f, CvPoint2D32f)’:
./opencvx/cvcreateaffine.h:61: error: ‘__BEGIN__’ was not declared in this 
scope
./opencvx/cvcreateaffine.h:95: error: ‘__END__’ was not declared in this 
scope
./opencvx/cvcreateaffine.h:62: error: label ‘exit’ used but not defined
In file included from ./opencvx/cvxrectangle.h:39,
                 from ./facetrack.cpp:48:
./opencvx/cvdrawrectangle.h: In function ‘void cvDrawRectangle(IplImage*, 
CvRect32f, CvPoint2D32f, CvScalar, int, int, int)’:
./opencvx/cvdrawrectangle.h:84: error: ‘__BEGIN__’ was not declared in this 
scope
./opencvx/cvdrawrectangle.h:177: error: ‘__END__’ was not declared in this 
scope
./opencvx/cvdrawrectangle.h:85: error: label ‘exit’ used but not defined
In file included from ./opencvx/cvcropimageroi.h:35,
                 from ./opencvx/cvxrectangle.h:40,
                 from ./facetrack.cpp:48:
./opencvx/cvget2dinter.h: In function ‘CvScalar icvGet2DInterNn(const CvArr*, 
float, float)’:
./opencvx/cvget2dinter.h:49: error: ‘__BEGIN__’ was not declared in this 
scope
./opencvx/cvget2dinter.h:58: error: ‘__END__’ was not declared in this scope
./opencvx/cvget2dinter.h:53: error: label ‘exit’ used but not defined
./opencvx/cvget2dinter.h: In function ‘CvScalar icvGet2DInterLinear(const 
CvArr*, float, float)’:
./opencvx/cvget2dinter.h:84: error: ‘__BEGIN__’ was not declared in this 
scope
./opencvx/cvget2dinter.h:118: error: ‘__END__’ was not declared in this 
scope
./opencvx/cvget2dinter.h:88: error: label ‘exit’ used but not defined
./opencvx/cvget2dinter.h: In function ‘CvScalar cvGet2DInter(const CvArr*, 
float, float, int)’:
./opencvx/cvget2dinter.h:144: error: ‘__BEGIN__’ was not declared in this 
scope
./opencvx/cvget2dinter.h:157: error: ‘__END__’ was not declared in this 
scope
./opencvx/cvget2dinter.h:154: error: label ‘exit’ used but not defined
In file included from ./opencvx/cvxrectangle.h:40,
                 from ./facetrack.cpp:48:
./opencvx/cvcropimageroi.h: In function ‘void cvCropImageROI(const IplImage*, 
IplImage*, CvRect32f, CvPoint2D32f, int)’:
./opencvx/cvcropimageroi.h:74: error: ‘__BEGIN__’ was not declared in this 
scope
./opencvx/cvcropimageroi.h:159: error: ‘__END__’ was not declared in this 
scope
./opencvx/cvcropimageroi.h:75: error: label ‘exit’ used but not defined
In file included from ./opencvx/cvxrectangle.h:44,
                 from ./facetrack.cpp:48:
./opencvx/cvinvaffine.h: In function ‘void cvInvAffine(const CvMat*, 
CvMat*)’:
./opencvx/cvinvaffine.h:44: error: ‘__BEGIN__’ was not declared in this 
scope
./opencvx/cvinvaffine.h:57: error: ‘__END__’ was not declared in this scope
./opencvx/cvinvaffine.h:45: error: label ‘exit’ used but not defined
In file included from ./opencvx/cvxrectangle.h:45,
                 from ./facetrack.cpp:48:
./opencvx/cvcreateaffineimage.h: In function ‘IplImage* 
cvCreateAffineImage(const IplImage*, const CvMat*, int, CvPoint*, CvScalar)’:
./opencvx/cvcreateaffineimage.h:81: error: ‘__BEGIN__’ was not declared in 
this scope
./opencvx/cvcreateaffineimage.h:160: error: ‘__END__’ was not declared in 
this scope
./opencvx/cvcreateaffineimage.h:82: error: label ‘exit’ used but not defined
In file included from ./opencvx/cvparticle.h:53,
                 from ./facetrack.cpp:52:
./opencvx/cvlogsum.h: In function ‘CvScalar cvLogSum(const CvArr*)’:
./opencvx/cvlogsum.h:52: error: ‘__BEGIN__’ was not declared in this scope
./opencvx/cvlogsum.h:79: error: ‘__END__’ was not declared in this scope
./opencvx/cvlogsum.h:56: error: label ‘exit’ used but not defined
In file included from ./opencvx/cvparticle.h:54,
                 from ./facetrack.cpp:52:
./opencvx/cvanglemean.h: In function ‘CvScalar cvAngleMean(const CvArr*, 
const CvArr*, double)’:
./opencvx/cvanglemean.h:65: error: ‘__BEGIN__’ was not declared in this 
scope
./opencvx/cvanglemean.h:111: error: ‘__END__’ was not declared in this scope
./opencvx/cvanglemean.h:70: error: label ‘exit’ used but not defined
In file included from ./facetrack.cpp:52:
./opencvx/cvparticle.h: In function ‘CvParticle* cvCreateParticle(int, int, 
bool)’:
./opencvx/cvparticle.h:125: error: ‘__BEGIN__’ was not declared in this 
scope
./opencvx/cvparticle.h:146: error: ‘__END__’ was not declared in this scope
./opencvx/cvparticle.h:126: error: label ‘exit’ used but not defined
./opencvx/cvparticle.h: In function ‘void cvReleaseParticle(CvParticle**)’:
./opencvx/cvparticle.h:159: error: ‘__BEGIN__’ was not declared in this 
scope
./opencvx/cvparticle.h:161: error: ‘EXIT’ was not declared in this scope
./opencvx/cvparticle.h:172: error: ‘__END__’ was not declared in this scope
./opencvx/cvparticle.h:163: error: label ‘exit’ used but not defined
./opencvx/cvparticle.h: In function ‘void cvParticleSetDynamics(CvParticle*, 
const CvMat*)’:
./opencvx/cvparticle.h:187: error: ‘__BEGIN__’ was not declared in this 
scope
./opencvx/cvparticle.h:192: error: ‘__END__’ was not declared in this scope
./opencvx/cvparticle.h:188: error: label ‘exit’ used but not defined
./opencvx/cvparticle.h: In function ‘void cvParticleSetNoise(CvParticle*, 
CvRNG, const CvMat*)’:
./opencvx/cvparticle.h:206: error: ‘__BEGIN__’ was not declared in this 
scope
./opencvx/cvparticle.h:211: error: ‘__END__’ was not declared in this scope
./opencvx/cvparticle.h:207: error: label ‘exit’ used but not defined
./opencvx/cvparticle.h: In function ‘void cvParticleSetBound(CvParticle*, 
const CvMat*)’:
./opencvx/cvparticle.h:224: error: ‘__BEGIN__’ was not declared in this 
scope
./opencvx/cvparticle.h:229: error: ‘__END__’ was not declared in this scope
./opencvx/cvparticle.h:225: error: label ‘exit’ used but not defined
./opencvx/cvparticle.h: In function ‘void cvParticleGetMean(const 
CvParticle*, CvMat*)’:
./opencvx/cvparticle.h:261: error: ‘__BEGIN__’ was not declared in this 
scope
./opencvx/cvparticle.h:297: error: ‘__END__’ was not declared in this scope
./opencvx/cvparticle.h:262: error: label ‘exit’ used but not defined
In file included from ./observepca.h:35,
                 from ./facetrack.cpp:56:
./opencvx/cvpcadiffs.h: In function ‘void cvMatPcaDiffs(const CvMat*, const 
CvMat*, const CvMat*, const CvMat*, CvMat*, int, bool)’:
./opencvx/cvpcadiffs.h:102: error: ‘__BEGIN__’ was not declared in this 
scope
./opencvx/cvpcadiffs.h:201: error: ‘__END__’ was not declared in this scope
./opencvx/cvpcadiffs.h:103: error: label ‘exit’ used but not defined
In file included from ./observepca.h:36,
                 from ./facetrack.cpp:56:
./opencvx/cvgaussnorm.h: In function ‘void cvGaussNormImage(const CvArr*, 
CvArr*)’:
./opencvx/cvgaussnorm.h:66: error: ‘__BEGIN__’ was not declared in this 
scope
./opencvx/cvgaussnorm.h:108: error: ‘__END__’ was not declared in this scope
./opencvx/cvgaussnorm.h:69: error: label ‘exit’ used but not defined
./facetrack.cpp: In function ‘void icvGetRegion(IplImage*, CvRect*)’:
./facetrack.cpp:317: warning: deprecated conversion from string constant to 
‘char*’
make: *** [facetrack.o] Error 123

Original issue reported on code.google.com by [email protected] on 19 Dec 2010 at 4:25

@GoogleCodeExporter
Copy link
Author

I finally managed to get this to compile.

What I had to do was replace every instance 
of __BEGIN__ with __CV_BEGIN__
of __END__ with __CV_END__
of EXIT with exit(0)

Attached is a python script which will do the replaces for you.
Change the variable directory to the appropriate location.

Original comment by [email protected] on 19 Dec 2010 at 6:06

Attachments:

@GoogleCodeExporter
Copy link
Author

Alternatively, you can use sed;
{{for file in $(grep -lre BEGIN ./*|grep -v svn); do sed -e 
"s/_BEGIN_/_CV_BEGIN_/;s/_END_/_CV_END_/" $file -i; done}}

Original comment by [email protected] on 7 Mar 2011 at 7:06

@GoogleCodeExporter
Copy link
Author

Thanks man! That saved me a lot of time!

Original comment by [email protected] on 25 Apr 2012 at 5:38

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

i am also having the same problem while compiling ie "__BEGIN__ is not Declared 
within this scope" plz somebody reply. im using ubuntu 12.04 version , and 
opencv 2.3.1 version plz help.

Original comment by [email protected] on 4 Feb 2013 at 8:27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant