How to Configure Qt to Use OpenCV Static Build in Linux

First of all I assume you have seen this post which describes how to build opencv statically for Linux. If that is the case then you can just add the following code to your qmake .PRO file to use opencv with Qt.



unix: {
	CONFIG += link_pkgconfig
	PKGCONFIG += opencv
}

2 Replies to “How to Configure Qt to Use OpenCV Static Build in Linux”

  1. Thanks for your tutorials, they are being very helpful !
    I compiled a shared library linked to static opencv and it worked. When I try to compile other project using the shared library I wrote, I get some errors on the compiler saying undefined reference to the ipp functions on the “.so ” file.
    The errors are like:
    ../output/lib_foo.so: undefined reference to `ippicviMean_16s_C3R’
    there are some other errors, all related to ipp functions. lib_foo.so is the shared library I created and I get that errors when I try to compile an application using my shared library.

    1. Obviously it has something to do with the way you are linking. It seems to me that you are trying to link to a library that has some parts built into it statically (opencv) and some parts built shared (ipp).
      I didn’t quite understand why would you want to do it like this?! I assume you are writing a library of your own that uses OpenCV, is that right? If that’s the case I’d recommend you to go for shared opencv instead of static.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.