INCLUDEPATH+="C:/.../opencv/build/include"LIBS+="C:/.../opencv/build/x64/vc14/lib/opencv_world330.lib"
undefined reference to'cvLoadImage'
C:\...\windres.exe:unknown option -- W...
I also had this issue when I compiled OpenCV3.3 source code for Qt. Then I found the hint here(https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows).++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ If you have the following error : ... windres.exe: unknown option -- W ...try this : in cmake uncheck ENABLE_PRECOMPILED_HEADERSIf, in the file opencv/sources/modules/videoio/src/cap_dshow.cpp, you have the following error : 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope ...try this :put the following line: #define NO_DSHOW_STRSAFE, before the line : #include "DShow.h"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
NCLUDEPATH += "C:\Qt\Qt5.7.0\opencv\build\include"LIBS += "C:/Qt/Qt5.7.0/opencv/build/lib/libopencv_calib3d330.dll.a"LIBS += "C:/Qt/Qt5.7.0/opencv/build/lib/libopencv_core330.dll.a"LIBS += "C:/Qt/Qt5.7.0/opencv/build/lib/libopencv_dnn330.dll.a"LIBS += "C:/Qt/Qt5.7.0/opencv/build/lib/libopencv_features2d330.dll.a"LIBS += "C:/Qt/Qt5.7.0/opencv/build/lib/libopencv_imgcodecs330.dll.a"LIBS += "C:/Qt/Qt5.7.0/opencv/build/lib/libopencv_imgproc330.dll.a"LIBS += "C:/Qt/Qt5.7.0/opencv/build/lib/libopencv_ml330.dll.a"LIBS += "C:/Qt/Qt5.7.0/opencv/build/lib/libopencv_objdetect330.dll.a"LIBS += "C:/Qt/Qt5.7.0/opencv/build/lib/libopencv_shape330.dll.a"LIBS += "C:/Qt/Qt5.7.0/opencv/build/lib/libopencv_stitching330.dll.a"LIBS += "C:/Qt/Qt5.7.0/opencv/build/lib/libopencv_superres330.dll.a"LIBS += "C:/Qt/Qt5.7.0/opencv/build/lib/libopencv_video330.dll.a"LIBS += "C:/Qt/Qt5.7.0/opencv/build/lib/libopencv_videoio330.dll.a"LIBS += "C:/Qt/Qt5.7.0/opencv/build/lib/libopencv_videostab330.dll.a"LIBS += "C:/Qt/Qt5.7.0/opencv/build/lib/libopencv_photo330.dll.a"LIBS += "C:/Qt/Qt5.7.0/opencv/build/lib/libopencv_highgui330.dll.a"
C++ (Qt)#include <opencv/cv.h>#include <opencv/cvwimage.h>#include <opencv2/imgcodecs.hpp>#include <opencv/highgui.h>#include <opencv2/highgui.hpp>#include <opencv2/highgui/highgui.hpp>#include <opencv2/opencv_modules.hpp>#include <opencv2/imgproc/imgproc.hpp>#include <opencv2/imgproc.hpp> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow){ ui->setupUi(this); IplImage *img = cvLoadImage("D:\picture.jpg"); cvNamedWindow("Hello, Qt! From OpenCv"); cvShowImage("Hello, Qt! From OpenCV!",img); cvWaitKey(); } MainWindow::~MainWindow(){ delete ui;}