Size missmatch Error when trying to use OpenCV with QT

  • Hi all,

    I have run into problems with getting OpenCV working with QT. I am sitting on a machine using an up-to-date Kubuntu installation, QT 5.3 and OpenCV 2.4.9. Everything works on it's own, but as soon as I want to compile something like "Mat mat1 = cv::imread(fileName);" I get the following Error: "QMetaType::registerType: Binary compatibility break -- Size mismatch for type 'QPaintBufferCacheEntry' [1024]. Previously registered size 0, now registering size 16."

    My project compiles fine on a different machine, so I guess there's something wrong with my installation. I followed the steps found here: .

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Are you sure you have OpenCV built with Qt5 ?

  • Hi,

    Is there a way to check that? I am pretty new to cmake and Qt. As said I just followed the steps from "Installation in Linux", which led to a working OpenCV installation, as the example apps compile and run. But it refuses to work with Qt. Do I have to tell cmake somehow to use Qt for building?

  • Lifetime Qt Champion

    You can call ldd on to see what libraries are linked

Log in to reply

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