开发者

OpenCV in Qt Creator

开发者 https://www.devze.com 2022-12-19 09:40 出处:网络
Since I am very UNHAPPY with Visual Studio (It\'s just Junk!) I am trying to use Qt Creator, which seems to be the solution for my c++ projects to get easily run in my Mac also.

Since I am very UNHAPPY with Visual Studio (It's just Junk!) I am trying to use Qt Creator, which seems to be the solution for my c++ projects to get easily run in my Mac also. But I am us开发者_如何学运维ing OpenCV. So, How do I set libraries in Qt? (include folder and maybe some libs)

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

But getting many errors since Qt does not know where to find the libraries, where should I enter the paths or something?

Help will be very well appreciated.

Ignacio


I think I have answered 2 Qt questions that recoup what you are asking :

The first answer is about OpenCV integration in Qt: OpenCV with other GUI (like Qt or WxWidgets) on Win32 VC++

And the second about using 3rd party libraries in Qt: How do i reference the qjson.dll file from my qt project?


I know that this is an old thread but this answer might help anyone on unix trying to link to OpenCV 2.3.1 +

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

unix {
   CONFIG += link_pkgconfig
   PKGCONFIG += opencv
}

Thats it if you are on a unix based system.


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

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


Partial answer to myself:

See qmake project files, declaring other libraries.

But I think I will have to compile OpenCV for Linux as I don't think opencv.framework will work with LIBS.

Is there any variable like FRAMEWORKS?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号