Updated by Andrey Kamaev almost 13 years ago

I receive a compiler compilator error when I include the @highgui.hpp@ highgui.hpp file in my project proyect using Xcode 3.2.6. The error that is given is:

<pre>
/opt/local/include/opencv2/core/core.hpp:428:0
*/opt/local/include/opencv2/core/core.hpp:428:0 /opt/local/include/opencv2/core/core.hpp:428: error: statement-expressions are allowed only inside functions
</pre>
functions*

On the other hand when I use the file @highgui_c.h@ highgui_c.h I receive a @EXEC_BAD_ACCES@ EXEC_BAD_ACCES signal when I try to use the @cvCreateVideoWriter@. cvCreateVideoWriter. The code is below:

<pre><code class="cpp">
*- (bool) testRecord{
CvCapture *c = cvCreateCameraCapture(0);

int isColor = 1;
int fps = 30; // or 30
int frameW = 640; // 744 for firewire cameras
int frameH = 480; // 480 for firewire cameras
CvVideoWriter *w = cvCreateVideoWriter("~/Desktop/out.mov",CV_FOURCC('M','J','P','G'),fps,cvSize(frameW,frameH),isColor);

IplImage *f = 0;
while (1) {
f = cvQueryFrame(c);
cvWriteFrame(w, f); // add the frame to the file
cvWaitKey(25);
}

cvReleaseVideoWriter(&w);
cvReleaseCapture(&c);

NSLog(@"Terminamos");

return 0;
*

}
</code></pre>

Back