0
votes

Sorry for asking a question thats already asked by some.. But even after many days of search and tries i couldnt make opencv work with qt creator.. Hope any body can give me the steps for doing so.

Last time i tried by calling just one opencv specific function to check if it compiles correctly, but its giving some errors which are due to linking problems, i have built the opencv library using my mingw compiler from code blocks as described in some of the tutorials, even that didnt work.

I'm getting this error

:-1: error: cannot find -lopencv_core

:-1: error: collect2: ld returned 1 exit status

My pro file looks as follows

QT += core

TARGET = Open_cv_integration

CONFIG += console

TEMPLATE = app

SOURCES += main.cpp

LIBS += "C:/opencv2.2MinGW/lib/libopencv_core231.dll.a"

LIBS += -lm -lopencv_core -lopencv_highgui -lopencv_video -lopencv_imgproc

1
actually this is working for me INCLUDEPATH += C:/opencv2.2MinGW/include LIBS += C:/opencv2.2MinGW/bin/*.dll and i had to copy all dll's required for me to the system32 directory.user1159585

1 Answers

0
votes
LIBS += \
  -LD:\your lib directory\ -llibopencv_highgui231 \
INCLUDEPATH += \
   D:/your include dir/include/

should work for you. QtCreator has very good help, and there is said how to add lib to project.