Results 1 to 2 of 2

Thread: QT application not loading, exiting with exit code 0, opencv.

  1. #1
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default QT application not loading, exiting with exit code 0, opencv.

    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 Code:
    1. QT += core
    2. QT -= gui
    3.  
    4. TARGET = myQtConsoleProject
    5. CONFIG += console
    6. CONFIG -= app_bundle
    7.  
    8. TEMPLATE = app
    9. SOURCES += main.cpp
    10.  
    11. INCLUDEPATH += C:\\opencv\\release\\include
    12.  
    13. LIBS += -LC:\\opencv\\release\\lib \
    14. -lopencv_core231.dll \
    15. -lopencv_highgui231.dll \
    16. -lopencv_imgproc231.dll \
    17. -lopencv_features2d231.dll \
    18. -lopencv_calib3d231.dll
    To copy to clipboard, switch view to plain text mode 

    The application output is

    Qt Code:
    1. Starting C:\Users\chris\QT\myQtConsoleProject-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Release\release\myQtConsoleProject.exe...
    2. C:\Users\chris\QT\myQtConsoleProject-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Release
    To copy to clipboard, switch view to plain text mode 

    \release\myQtConsoleProject.exe exited with code 0

    The contents of my source code is as follows:
    Qt Code:
    1. #include <stdio.h>
    2. #include <opencv2/core/core.hpp>
    3. #include <opencv2/highgui/highgui.hpp>
    4. int main() {
    5. printf("not outputting...\n");
    6. cv::Mat image= cv::imread("C:/temp/img.jpg");
    7. cv::namedWindow("My Image");
    8. cv::imshow("My Image", image);
    9. cv::waitKey(50000);
    10. return 1;
    11. }
    To copy to clipboard, switch view to plain text mode 

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

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT application not loading, exiting with exit code 0, opencv.

    Why is this?
    Run the application in a debugger, and show the line on which it crashes.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 2
    Last Post: 7th July 2011, 11:20
  2. Exit Code 3
    By RSX in forum Newbie
    Replies: 4
    Last Post: 11th March 2011, 01:44
  3. Replies: 2
    Last Post: 21st November 2010, 19:03
  4. Exit button that does a task before exiting
    By Roelof in forum Qt Programming
    Replies: 5
    Last Post: 11th September 2009, 15:21
  5. Exiting a Qt Console Application
    By nbetcher in forum Qt Programming
    Replies: 4
    Last Post: 23rd March 2009, 22:03

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.