error: argument of type

Joined
Apr 16, 2010
Messages
2
Reaction score
0
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::eek:nTrackbarSlide(int pos)
{
cvSetCaptureProperty(g_capture, CV_CAP_PROP_POS_FRAMES, pos);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top