Linking OpenCV 3.2.0 library with Qt 5.4
-
I had downloaded the libraries for OpenCV and wanted to connect it to Qt for my project. I am doing this on Windows 10. I want to develop a GUI that would be able to upload and play video. But I have an error saying that "No such file or directory"
.pro file
INCLUDEPATH += C:/opencv-3.2.0-vc14/opencv/build/include/opencv2LIBS += LC:/opencv-3.2.0-vc14/opencv/build/bin -libopencv_core -libopencv_imgproc -libopencv_highgui
header file
#ifndef DIALOG_H
#define DIALOG_H#include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
#include<opencv2/core/types.hpp>#include <QDialog>
namespace Ui {
class Dialog;
}class Dialog : public QDialog
{
Q_OBJECTpublic:
explicit Dialog(QWidget *parent = 0);
~Dialog();public slots:
void processFrameAndUpdateGUI();private slots:
void on_btnPauseOrResume_clicked();private:
Ui::Dialog *ui;// Declare variables while linking them to opencv libraries
error message
error: opencv2/core/core.hpp: No such file or directory
#include<opencv2/core/core.hpp>
^ -
Hi and welcome to devnet,
Remove the
opencv2
at the end of yourINCLUDEPATH
statement. -
You are missing a
-
before theL
in yourLIBS
statement. -
Hi
But if you are using mingw compiler and that opencv-3.2.0-vc14 really sounds like visual studio compiler.
Are we not trying to use visual studio DLLS with mingw compiler ?
I assume you did not build openCV yourself but just downloaded and unpacked it ?
-
@Syazwany if your issue is solved, please don't forget to mark your post as such. Thank you