"CvOpenGLCallback has not been declared" error, how do I deal with that?

asked 2014-01-30 07:00:21 -0600

Irene gravatar image

updated 2014-01-30 22:49:53 -0600

Hello, I am new to OpenCV and QT, so perhaps the question is in the wrong section. I use OpenCV 2.4.8 and QT 5.2.2, I was trying to build the project i found on the web, it was made in QT 4.7 and OpenCV 2.3 and I get this nasty error.
Google says CvOpenGLCallback derives from opencv_highgui, so I added highgui.h in the header file and it didn't work. Is there a way to deal with it or i should better find older versions of programs and try using them? Thank you.

UPD: Here's the code.

CV_IMPL void cvCreateOpenGLCallback( const char* window_name, CvOpenGLCallback callbackOpenGL, void* userdata, double angle, double zmin, double zmax)
{
    if (!guiMainThread)
        CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
    QMetaObject::invokeMethod(guiMainThread,
        "setOpenGLCallback",
        Qt::AutoConnection,
        Q_ARG(QString, QString(window_name)),
        Q_ARG(void, (void)callbackOpenGL),
        Q_ARG(void*, userdata),
        Q_ARG(double, angle),
        Q_ARG(double, zmin),
        Q_ARG(double, zmax)
        );
}
This bit is in "window_QT.cpp", so it must be used only when window opens.

edit retag flag offensive close merge delete

Comments

hi irene, could you edit and add some bits of code to your question ?

its probably related to setopengldrawcallback .

"or i should better find older versions" - nooo, the opposite ! CvOpenGLCallback sounds like the old c-api, and you should avoid it

berak gravatar imageberak ( 2014-01-30 08:01:57 -0600 )edit

Thank you, berak! I added the code (but for now I dealt with the problem by commenting the whole procedure))

Irene gravatar imageIrene ( 2014-01-30 22:55:53 -0600 )edit