K
K
kolomiec_artiom2018-07-06 15:42:23
Qt
kolomiec_artiom, 2018-07-06 15:42:23

How to install OpenCV for C++ in QT Creator?

Good afternoon! Installed OpenCV (Downloaded and unpacked).
Then I created a project in QT Creator, in the .pro file I specified the paths for the libraries:

INCLUDEPATH+=C:\opencv\build\include\

LIBS+= C:\\opencv\\pro\\lib\\opencv_core2413d.dll
LIBS+= C:\\opencv\\pro\\lib\\opencv_highgui2413d.dll

Then in the .cpp file I loaded:
#include "opencv2/core/mat.hpp"
#include <opencv/cv.h>
#include <opencv2/core/core.hpp>

#include <opencv2/highgui/highgui.hpp>

And when debugging, I get errors:
5b3f635f3d99c125057930.png
As I understand it, this is due to the fact that it cannot find the required library. So, question. Why did this happen?
It will be great if you send a guide on installing OpenCV for C ++ in QT Creator. Maybe there are some mistakes

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mercury13, 2018-07-06
@Mercury13

LIBS += -LC:/opencv/pro/lib -lxxx
xxx is the filename with a extension, without extension and lib prefix.
If it is libopencv_core.a, then you need -lopencv_core

A
Artem Filimonov, 2018-07-18
@Nvek

INCLUDEPATH += C:/opencv/build/include
LIBPATH += C:/opencv/pro/lib
LIBS += -lopencv_core
should work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question