[Moved] "exited with code 0" error

  • I study opencv in qt. and I met error that .exe exited with code 0. I dont understand why is that. Can anyone help me immediately!!

  • Error 0 is the OK status code. Nothing to worry about. If you get something other than 0 back, you have a problem.

  • but I dont take result. how is ok?

  • It simply means your code returned with no (zero) errors.

  • are you seriously! I understand it. But I studying say that why don't I take a result? have you an answer

  • What is the result ,that you expect ?

  • To be honest I don't really understand your english. I don't want to insult you or anything, its just hard to make some sense from your question.

    You don't have to print a result or anything in the console to get that output. if you execute even the simplest code like a "hello world"-application your main method returns a value once its finished. And this value is 0 if everything went ok.

    Maybe you can post some code so we can understand your problem better?

  • Firstly I'm sorry for my english. I expect that my camera will run. but it does not

  • @#include <QtCore/QCoreApplication>
    #include <stdio.h>
    #include <cv.h>
    #include <highgui.h>
    #include <highgui.hpp>
    #include <cvaux.h>
    #include <cvwimage.h>
    #include <cv.hpp>

    tCvHaarClassifierCascade *cascade;
    CvMemStorage *storage;

    void detectFaces(IplImage *img);

    int main(int argc,char**argv)
    CvCapture *capture;
    IplImage *frame;
    int key;
    char *filename="C:\opencv\opencv\data\haarcascades\haarcascade_frontalface_alt.xml";

    return 0;


    void detectFaces(IplImage *img)
    int i;
    CvSeq *faces=cvHaarDetectObjects(img,cascade,storage,1.1,3,0,cvSize(40,40));

        CvRect *r=(CvRect*)cvGetSeqElem(faces,i);



    ---this is my .cpp file.

  • I must assume that, you are using Qt Mobility , and some part of your code doesn't work. i could try to help you if you share more details or code.

  • sorry, my previous post wasn't timely.pls Ignore it.

  • Thank you so much.
    I am using OQ creator and this project is console app. I am sending my .pro file.

    Project created by QtCreator 2011-12-12T12:18:39


    QT += core

    QT -= gui

    TARGET = calisma1
    CONFIG += console
    CONFIG -= app_bundle

    TEMPLATE = app

    SOURCES += main.cpp

    INCLUDEPATH +=C:/opencvbuild/install/include/opencv
    INCLUDEPATH +=C:/opencvbuild/install/include/opencv2/highgui
    INCLUDEPATH +=C:/opencvbuild/install/include

    LIBS += C:/opencvbuild/install/bin/*.dll

    HEADERS +=


  • anybody help me. it is very important for me

  • when this .cpp file is written in console app. , it gives "exited with code 0" message. But when this .cpp file is written in empty file , it gives "exited with code -1073741511" message. why!!

  • Frankly, i don't know much about openCV. Anyway, exited with 0 is the result of @ return 0;@ in your main(). And That means ,successful completion of the execution.

    And what does Qt do in your application ?

    EDIT : Just noticed : in your pro file, @LIBS += C:/opencvbuild/install/bin/*.dll@ I am bit doubtful about this part. I am not sure,wildcard can be used in here.

  • in console application! ...

  • yes, i know its a console application. But this is not really a Qt application right? i mean,Not a Qt-console application. I couldn't find usage of Qt APIs anywhere in codes

    [quote author="kuheylan" date="1323711448"]in console application! ...[/quote]

  • But my friend used this code in qt and he says that it runs and camera runs. you are right it is not really a qt app. I found it

  • Please kuheylan, calm down a bit. Don't flag your message as urgent, even if it is for you. It is hard for people to guess what is going wrong in your code, especially if they don't see it.

    Your code does not look like real Qt code to me. Normally, Qt code creates a Q(Core)Application, calls exec() on that, and only exits when the eventloop is terminated. You are just creating a loop of your own, and I fail to see the connection between Qt and your code. Your code doesn't use a single Qt class. Perhaps you should ask your question in an OpenCV channel?

  • [quote author="kuheylan" date="1323711840"]But my friend used this code in qt and he says that it runs and camera runs. you are right it is not really a qt app. I found it[/quote]

    So... It is not even your code, but something you found off the net and your friend states works, and now you expect us to support it and help you figure out what it is doing? Sorry, it doesn't work like that. Please do your own homework.

  • Moved to the General forum, this seems to be the least inappropriate one for this.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.