Getting error while compiling opencv sample program

asked 2013-09-19 14:09:04 -0500

mainul gravatar image

Hi,

I have installed opencv following the steps mentioned in opencv wiki. Then I tried to compile and build the sample programs provided in the sample folder I got error. I tried to run my code but that did not work so I tried to run the sample code first and I got the following error:

rt: No such file or directory pthread: No such file or directory m: No such file or directory dl: No such file or directory

I removed those rt,pthread,m,dl from opencv.pc file. Then I tried to compile the sample codes again. Now I got many more errors. For example:

compiling bgfg_codebook.cpp bgfg_codebook.cpp: In function ‘int main(int, const char*)’: bgfg_codebook.cpp:108:39: error: ‘cvCaptureFromCAM’ was not declared in this scope bgfg_codebook.cpp:113:57: error: ‘cvCreateFileCapture’ was not declared in this scope bgfg_codebook.cpp:128:46: error: ‘cvQueryFrame’ was not declared in this scope bgfg_codebook.cpp:145:37: error: ‘cvNamedWindow’ was not declared in this scope bgfg_codebook.cpp:171:42: error: ‘cvShowImage’ was not declared in this scope bgfg_codebook.cpp:177:25: error: ‘cvWaitKey’ was not declared in this scope bgfg_codebook.cpp:235:32: error: ‘cvReleaseCapture’ was not declared in this scope bgfg_codebook.cpp:236:28: error: ‘cvDestroyWindow’ was not declared in this scope compiling blobtrack_sample.cpp blobtrack_sample.cpp: In function ‘int RunBlobTrackingAuto(CvCapture, CvBlobTrackerAuto, char, char*)’: blobtrack_sample.cpp:140:64: error: ‘cvWaitKey’ was not declared in this scope blobtrack_sample.cpp:152:33: error: ‘cvQueryFrame’ was not declared in this scope blobtrack_sample.cpp:175:50: error: ‘CV_FOURCC’ was not declared in this scope blobtrack_sample.cpp:177:27: error: ‘cvCreateVideoWriter’ was not declared in this scope.

I installed and reinstalled opencv three times. But still no luck. I tried to run the sample codes from this location: Opencv/samples/c/

I do not know what to do now. Can anyone help me with some idea?

edit retag flag offensive close merge delete

Comments

unfortunately, there's like 4 different platforms, and multiple ways to install opencv, so you'll have to tell us, how you tried, your os, etc.

and, since you're a beginner, try the cpp samples, not the old c ones

berak gravatar imageberak ( 2013-09-19 14:17:01 -0500 )edit

oh I forgot to mention that. I am using Ubuntu 12.04. I followed these two pages to install: http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.htmlhttp://www.samontab.com/web/2012/06/installing-opencv-2-4-1-ubuntu-12-04-lts/

Then I tried to compile and run the sample codes. I tried to run the CPP ones also but got the same error.

mainul gravatar imagemainul ( 2013-09-19 15:55:55 -0500 )edit