Cannot mix incompatible Qt library (version 0x40805) with this library (version 0x40804)



  • Hi i have configured Qt for Visual Studio 2008 based on the instructions in http://docs.opencv.org/2.4.4/doc/tutorials/introduction/windows_install/windows_install.html#installation-by-making-your-own-libraries-from-the-source-files
    i got the opengl support but when i try to run the following command
    #include "stdafx.h"
    int tmain(int argc, _TCHAR* argv[])
    {
    return 0;
    }
    #include
    #include
    #include <opencv2/core/openglinterop.hpp>
    #include
    #include "E:\OpenCV\Build\cvconfig.h"
    #ifndef HAVE_OPENGL
    int main()
    {
    std::cerr << "Library was built without OpenGL support" << std::endl;
    return -1;
    }
    #else

    #ifdef WIN32
    #define WIN32_LEAN_AND_MEAN 1
    #define NOMINMAX 1
    #include
    #endif

    #if defined(APPLE)
    #include
    #include
    #else
    #include
    #include
    #endif

    using namespace cv;
    using namespace std;
    void on_opengl(void* userdata);

    int main(void)
    {
    VideoCapture webcam(CV_CAP_ANY);

    namedWindow("window", CV_WINDOW_OPENGL);

    Mat frame;
    ogl::Texture2D tex;

    setOpenGlDrawCallback("window", on_opengl, &tex);

    while(waitKey(30) < 0)
    {
    webcam >> frame;
    tex.copyFrom(frame);
    updateWindow("window");
    }

    setOpenGlDrawCallback("window", 0, 0);
    destroyAllWindows();

    return 0;
    }

    void on_opengl(void* userdata)
    {
    ogl::Texture2D* pTex = static_castogl::Texture2D*(userdata);
    if (pTex->empty())
    return;

    glLoadIdentity();

    glTranslated(0.0, 0.0, 1.0);

    glRotatef( 55, 1, 0, 0 );
    glRotatef( 45, 0, 1, 0 );
    glRotatef( 0, 0, 0, 1 );

    static const int coords[6][4][3] = {
    { { +1, -1, -1 }, { -1, -1, -1 }, { -1, +1, -1 }, { +1, +1, -1 } },
    { { +1, +1, -1 }, { -1, +1, -1 }, { -1, +1, +1 }, { +1, +1, +1 } },
    { { +1, -1, +1 }, { +1, -1, -1 }, { +1, +1, -1 }, { +1, +1, +1 } },
    { { -1, -1, -1 }, { -1, -1, +1 }, { -1, +1, +1 }, { -1, +1, -1 } },
    { { +1, -1, +1 }, { -1, -1, +1 }, { -1, -1, -1 }, { +1, -1, -1 } },
    { { -1, -1, +1 }, { +1, -1, +1 }, { +1, +1, +1 }, { -1, +1, +1 } }
    };

    glEnable(GL_TEXTURE_2D);
    pTex->bind();

    for (int i = 0; i < 6; ++i) {
    glColor3ub( i20, 100+i10, i42 );
    glBegin(GL_QUADS);
    for (int j = 0; j < 4; ++j) {
    glVertex3d(0.2
    coords[i][j][0], 0.2 * coords[i][j][1], 0.2*coords[i][j][2]);
    }
    glEnd();
    }
    }
    #endif

    I get the message opengl support available but Cannot mix incompatible Qt library (version 0x40805) with this library (version 0x40804)
    it is due to the lines namedWindow("window", CV_WINDOW_OPENGL); and setOpenGlDrawCallback("window", on_opengl, &tex);
    I am working on Windows 7 and have 2 versions of Microsoft SDK
    C:\Program Files\Microsoft SDKs\Windows\v6.0A (old version)
    C:\Program Files\Microsoft SDKs\Windows\v6.1 (new version)
    am not sure which opengl32 and glu32 is considered coz am not sure of the path
    Can someone please help me solve these error
    I downloaded qt-everywhere-opensource-src-4.8.5 from http://qt-project.org/downloads and extracted it in a qt folder .
    Someone please help me with error. Its urgent. Please


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    From the looks of it, you might be using an OpenCV built against Qt 4.8.4 in your Qt 4.8.5 project so basically you have two solution:

    • Build Qt 4.8.4
    • Rebuild OpenCV with Qt 4.8.5

    Hope it helps



  • But from where can i get Qt 4.8.4 open source code from. It would be a great help if i could get a download link for Qt 4.8.4 open source code.


  • Lifetime Qt Champion

    In the archive "here":http://download.qt-project.org/archive/qt/4.8/4.8.4/

    Or using git


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.