PDA

View Full Version : QT application not loading, exiting with exit code 0, opencv.



wwwater
12th September 2011, 22:46
I am trying to run a simple OpenCV program in QT Creator 2.3, QT 4.7.4. I know the syntax is correct, but my program does not get run. When I run it, I simply get the qtcreator_process_stub.exe window with "Press <RETURN> to close this window...".

Why is this? My .pro file looks as such:


QT += core
QT -= gui

TARGET = myQtConsoleProject
CONFIG += console
CONFIG -= app_bundle

TEMPLATE = app
SOURCES += main.cpp

INCLUDEPATH += C:\\opencv\\release\\include

LIBS += -LC:\\opencv\\release\\lib \
-lopencv_core231.dll \
-lopencv_highgui231.dll \
-lopencv_imgproc231.dll \
-lopencv_features2d231.dll \
-lopencv_calib3d231.dll

The application output is


Starting C:\Users\chris\QT\myQtConsoleProject-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Release\release\myQtConsolePro ject.exe...
C:\Users\chris\QT\myQtConsoleProject-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Release

\release\myQtConsoleProject.exe exited with code 0

The contents of my source code is as follows:


#include <stdio.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
int main() {
printf("not outputting...\n");
cv::Mat image= cv::imread("C:/temp/img.jpg");
cv::namedWindow("My Image");
cv::imshow("My Image", image);
cv::waitKey(50000);
return 1;
}


On my path, I have included "C:\opencv\release\bin"

high_flyer
13th September 2011, 09:56
Why is this?
Run the application in a debugger, and show the line on which it crashes.