OpenCV in Qt Creator

Since I'm very NOT GOOD with Visual Studio (it's just Junk!) I'm trying to use Qt Creator, which seems to be the solution for my C ++ projects, which also run easily on my Mac. But I use OpenCV. So how to install libraries in Qt? (including folder and possibly some libraries)

I am trying with this application: http://www.qt-apps.org/content/show.php/Qt+Opencv+webcam+viewer?content=89995

But there are a lot of errors, since Qt does not know where to find the libraries, where should I go in the path, or something like that?

Help would be very well appreciated.

Ignacio

+4
source share
4 answers

I think I answered two Qt questions that cancel what you ask:

The first answer is about integrating OpenCV into Qt: OpenCV with another graphical interface (e.g. Qt or WxWidgets) on Win32 VC ++

And the second about using third-party libraries in Qt: How do I link the qjson.dll file to my qt project?

+5
source

I know this is an old thread, but this answer can help any unix user trying to link to OpenCV 2.3.1 +

This is actually quite simple with pkgconfig. All you have to do is add the following to the qmake * .pro file:

unix { CONFIG += link_pkgconfig PKGCONFIG += opencv } 

This is if you are on a unix based system.

+3
source

Partial answer to yourself:

See the qmake project files for other libraries .

But I think that I will have to compile OpenCV for Linux, because I do not think that opencv.framework will work with LIBS.

Is there any variable of type FRAMEWORKS?

0
source

Warning, the answers above are outdated and misleading. Just set up your project with CMake, like opencv 2.x. Then you just install CMake to add $ OPENCV_LIBS as a library for communication, and you're done. In qt creator, file -> open project and open the file CMakeLists.txt, presto.

Do not use qmake or pro files unless you really want QT gui. Even then, first look at the QT samples in opencv 2.2+, I think they use cmake to handle the qt interface.

0
source

Source: https://habr.com/ru/post/1300709/


All Articles