PDA

View Full Version : Linking Error Qt OpenCV



Songi
23rd July 2011, 11:26
Hi Guys,
I'm new in this Forum, I have red a lot of thread about problem similar to mine one but no one help me.
I explain my problem:
-I made a project with a qt GUI, and I need to use OpenCV library to open and show a video in this GUI.
-When I build my project no errors are shown but when I run It show this message:

Starting C:\Users\ut\Documents\projectQt\video-build-desktop\debug\video.exe...
C:\Users\ut\Documents\projectQt\video-build-desktop\debug\video.exe exited with code -1073741511

So I've read lot of thread and I've understood that I've got problem with dll. But What are these dlls???
Some thread speak about dlls like QtCore4.dll et al. but I've included all necessary path in system variable. The same I've done for OpenCV dlls path(OpenCV\*\bin and OpenCV\*\lib).

So I tried to comment all openCV functions I call in my project and application run correctly.

So I think have a problem with openCV dlls but I can't understand what problem, this is my .pro file:


QT += core gui

TARGET = video
TEMPLATE = app


SOURCES += main.cpp\
mainwindow.cpp

HEADERS += mainwindow.h

FORMS += mainwindow.ui

INCLUDEPATH += C:\OpenCV\OpenCV-2.3.0\build\install\include

LIBS += -LC:\OpenCV\OpenCV-2.3.0\build\install\lib

LIBS += -llibopencv_core230 -llibopencv_imgproc230 -llibopencv_highgui230


I'll be glad to everyone help me!!!

Thank You EveryBody.

I forgot to say that I'am running on:

Win 7 64bit, with QtCreator

the OpenCV library run correctly if I use it stand-alone for example using the cvCreateWindow

high_flyer
25th July 2011, 14:59
So I've read lot of thread and I've understood that I've got problem with dll.
Usually when a DLL is missing the system will pop up a message telling you which DLL it could not find.
Since you are not getting this message, I think your problem is a segmentation fault and not a missing DLL.
Run your application in a debugger, and see which line crashes.
Post that part of code here, and we can try and help you further.

nosleduc
29th July 2011, 01:04
Have you tried in debug mode using the step-by-step mode ? I don't think it is a link problem but a bug when you use OpenCV maybe an exception or an assertion is raised

Chuong98
27th August 2011, 19:57
I have the trouble with set up QT and OpenCV too.
I am using OpenCV 2.3 and QT creator 4.73 Win 7 64 bits.
my main.cpp is copied from OpenCV 2 cooked book:"display the image"
The QT recognize the function when I type cv::im -> then it pop up cv::imread()
but don't know why it shows the error.
I tried running qmake. It runs with warning: pro:26 Unescape backslashes are deprecated
then try to run make: It returns error: make is not recognized as an internal or external command, operable program or batch file
Where should the file"make" be in?
Thanks so much

ChrisW67
28th August 2011, 04:03
If you are using the Qt SDK with MinGW then "make" is actually "mingw32-make".
If you are using Microsoft's compiler then "make" is "nmake" I think.

The warning from qmake is because you have a path or paths in your pro file that look like:
C:\Some\Path\To\Something
rather than escaping the backslashes:
C:\\Some\\Path\\To\\Something
or using forward slashes and letting qmake switch them for you.