"In the world ye shall have tribulation: but be of good cheer; I have overcome the world." –John 16:33

San Pedro Garza Garcia

Making QT 5.0.1 work with OpenCV 2.4.3

I have been working with QT in combination with OpenCV for several years now.  I recently had the opportunity to download the new QT 5.0.1 toolchain and QT Creator IDE.  The latest stable release of OpenCV at this writing is OpenCV 2.4.3 which I already had installed on my computer.  I generally use the prebuilt binaries whenever I can and that is what I did this time, too.  I loaded up one of my work projects, but the stuff would not work together nicely.  Builds would run just fine outside the debugger, but I gdb blew up inside QT Creator.  I had never really had that problem before and expected to get it fixed pretty quickly, but struggled for quite awhile.

In the end, as is often the case, it was something pretty trivial.  It turns out that the prebuilt binaries for OpenCV 2.4.3 use a different MinGW exception handling library (dw2) than QT 5.0.1 (sjlj).  The upshot is that I rebuilt the OpenCV libraries from the source using this specific MinGW toolchain–the one used to build QT 5.0.1.  Of course you will also need CMake to do this, but after that everything worked like a champ.

Previous

Cyrus in Isaiah

Next

Kelly interviews on the phone with Johns Hopkins

3 Comments

  1. Jon

    English translation, please? d:-D

  2. Dad

    Jon–Us old guys can’t figure stuff out as quickly as we used to, so when we spend two days trying to fix something that younger, smarter guys could figure out in 15 minutes, we write about it on our blog so other old slow guys don’t have to deal with the embarrassment of their inadequacies. They can just USE the answer instead of having to figure it out.

  3. Jon

    Haha. Love it.

Leave a Reply

Your email address will not be published. Required fields are marked *

Powered by WordPress & Theme by Anders Norén