Integrating OpenCV libraries in QtCreator on Windows
-
Hi and welcome to devnet,
You have to link to the lib files not the dlls. You should also try linking to only the libs your are using.
-
Hi:)
thank you very much for fast answer. But I don't have .lib files in my own compiled version I only .dll and .dll.a.
In the built version are some .lib files (although I think they are not for the mingw32-compiler I am using but for vc10)
I tried to link them but I get the same errorbq. :-1: Error: LNK1104: Cannot open file “libopencv_highgui231d.lib”
-
Then let's start at the beginning:
What compiler do you want to use ? Doesn't the OpenCV pre-built package give you what you need ? -
You should rather use something like
@LIBS += -LC:/OpenCV/opencv_bin/install/mingw/whathever
-lopencv_highgui231d
-lopencv_core231d
etc...
@ -
Yeah thank you very much:) when I added these lines in the .pro file the project gets compiled.
@LIBS += -LC:/OpenCV/opencv_bin/install/lib/ -llibopencv_core231d
-llibopencv_highgui231dINCLUDEPATH += C:/OpenCV/opencv_bin/install/include
DEPENDPATH += C:/OpenCV/opencv_bin/install/include
@Unfortunaley after the compiling there is just showing up the console and nothing happends :(
-
No error message ?
-
@mat = cv::imread("BM_Logo.JPG");@
relative path, in that case you should either copy the image in the same folder as your application or give the absolute path to it.
-
No doesnt change anything.
The strange thing is, even the "Hello World" doesnt appear if I use at least one function of the cv library only when I uncomment these functions the "hello world" appears.
the output window says:
bq. return value = -1073741515
and also the debugger crashes immediatly
edit:
I also tried compiling the project with the console, but when I start the .exe it says:
bq. The programm cannot be started, because the ..highgui249.dll is missing on this computer. Reinstall the programm ...
When I copy the dlls of opencv in the folder with the executable it says
bq. The programm cannot be started, because the ..QtCore4.dll is missing on this computer. Reinstall the programm ...
-
Looks like your OpenCV DLLs can't be found.
Go the run part of the Project panel, edit the PATH environment variable and add the path to the folder where the OpenCV dlls are located.
-
You're welcome !
Since OpenCV is working now, please update the thread title prepending [solved] so other forum users may know solution has been found :)