All,
I'm getting this error and I'm having a hard time figuring out how to get past it. I read somewhere abut making onTrackbarSlide static, but that seems to cause other issues.
Any ideas on how to move forward.
Mike
ERROR:
g++ -c -o vs.o vs.cpp
vs.cpp: In constructor ?myVS::myVS(int, char**)?:
vs.cpp:19: error: argument of type ?void (myVS:(int)? does not match ?void (*)(int)?
make: *** [vs.o] Error 1
vs.h
====================================
#include "../../OpenCV-2.1.0/include/opencv/highgui.h"
#include "../../OpenCV-2.1.0/include/opencv/cv.h"
#include <iostream>
#include <stdio.h>
class myVS
{
public:
myVS() {}
myVS ( int argc, char** argv );
~myVS();
void onTrackbarSlide( int pos );
int g_slider_position;
CvCapture* g_capture;
};
VS.cpp
====================================
myVS::myVS ( int argc, char** argv )
{
cout << "In Function: myVS" << endl;
g_slider_position = 0;
g_capture = NULL;
cvNamedWindow( "Example3", CV_WINDOW_AUTOSIZE );
g_capture = cvCreateFileCapture( argv[1] );
int frames = (int)cvGetCaptureProperty(g_capture, CV_CAP_PROP_FRAME_COUNT);
if ( 0 != frames )
{
cvCreateTrackbar("Position", "Example3", &g_slider_position, frames, onTrackbarSlide); // <------ LINE 19
}
}
void myVS:nTrackbarSlide(int pos)
{
cvSetCaptureProperty(g_capture, CV_CAP_PROP_POS_FRAMES, pos);
}
I'm getting this error and I'm having a hard time figuring out how to get past it. I read somewhere abut making onTrackbarSlide static, but that seems to cause other issues.
Any ideas on how to move forward.
Mike
ERROR:
g++ -c -o vs.o vs.cpp
vs.cpp: In constructor ?myVS::myVS(int, char**)?:
vs.cpp:19: error: argument of type ?void (myVS:(int)? does not match ?void (*)(int)?
make: *** [vs.o] Error 1
vs.h
====================================
#include "../../OpenCV-2.1.0/include/opencv/highgui.h"
#include "../../OpenCV-2.1.0/include/opencv/cv.h"
#include <iostream>
#include <stdio.h>
class myVS
{
public:
myVS() {}
myVS ( int argc, char** argv );
~myVS();
void onTrackbarSlide( int pos );
int g_slider_position;
CvCapture* g_capture;
};
VS.cpp
====================================
myVS::myVS ( int argc, char** argv )
{
cout << "In Function: myVS" << endl;
g_slider_position = 0;
g_capture = NULL;
cvNamedWindow( "Example3", CV_WINDOW_AUTOSIZE );
g_capture = cvCreateFileCapture( argv[1] );
int frames = (int)cvGetCaptureProperty(g_capture, CV_CAP_PROP_FRAME_COUNT);
if ( 0 != frames )
{
cvCreateTrackbar("Position", "Example3", &g_slider_position, frames, onTrackbarSlide); // <------ LINE 19
}
}
void myVS:nTrackbarSlide(int pos)
{
cvSetCaptureProperty(g_capture, CV_CAP_PROP_POS_FRAMES, pos);
}