Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Moved] "exited with code 0" error
QtWS25 Last Chance

[Moved] "exited with code 0" error

Scheduled Pinned Locked Moved General and Desktop
21 Posts 5 Posters 9.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kuheylan
    wrote on 12 Dec 2011, 15:12 last edited by
    #1

    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!!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on 12 Dec 2011, 15:18 last edited by
      #2

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

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kuheylan
        wrote on 12 Dec 2011, 15:31 last edited by
        #3

        but I dont take result. how is ok?

        1 Reply Last reply
        0
        • K Offline
          K Offline
          KA51O
          wrote on 12 Dec 2011, 15:38 last edited by
          #4

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

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kuheylan
            wrote on 12 Dec 2011, 15:41 last edited by
            #5

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

            1 Reply Last reply
            0
            • R Offline
              R Offline
              Rahul Das
              wrote on 12 Dec 2011, 15:46 last edited by
              #6

              What is the result ,that you expect ?


              Declaration of (Platform) independence.

              1 Reply Last reply
              0
              • K Offline
                K Offline
                KA51O
                wrote on 12 Dec 2011, 15:46 last edited by
                #7

                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?

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kuheylan
                  wrote on 12 Dec 2011, 15:51 last edited by
                  #8

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

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    kuheylan
                    wrote on 12 Dec 2011, 15:52 last edited by
                    #9

                    @#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";

                    cascade=(CvHaarClassifierCascade*)cvLoad(filename,0,0,0);
                    
                    storage=cvCreateMemStorage(0);
                    
                    capture=cvCaptureFromCAM(0);
                    
                    assert(cascade&&sorage&&capture);
                    
                    cvNamedWindow("video",1);
                    
                    while(key!='q')
                    {
                        frame=cvQueryFrame(capture);
                    
                        if(!frame)
                            break;
                    
                        cvFlip(frame,frame,-1);
                        frame->origin=0;
                    
                        detectFaces(frame);
                    
                        key=cvWaitKey(10);
                    }
                    
                    cvReleaseCapture(&capture);
                    cvDestroyWindow("video");
                    cvReleaseHaarClassifierCascade(&cascade);
                    cvReleaseMemStorage(&storage);
                    
                    
                    return 0;
                    

                    }

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

                    for(i=0;i<(faces?faces->total:0);i++)
                    {
                        CvRect *r=(CvRect*)cvGetSeqElem(faces,i);
                        cvRectangle(img,cvPoint(r->x,r->y),cvPoint(r->x+r->width,r->y+r->height),CV_RGB(255,0,0),1,8,0);
                    
                    }
                    
                    cvShowImage("video",img);
                    

                    }

                    @

                    ---this is my .cpp file.

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      Rahul Das
                      wrote on 12 Dec 2011, 15:54 last edited by
                      #10

                      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.


                      Declaration of (Platform) independence.

                      1 Reply Last reply
                      0
                      • R Offline
                        R Offline
                        Rahul Das
                        wrote on 12 Dec 2011, 15:58 last edited by
                        #11

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


                        Declaration of (Platform) independence.

                        1 Reply Last reply
                        0
                        • K Offline
                          K Offline
                          kuheylan
                          wrote on 12 Dec 2011, 15:58 last edited by
                          #12

                          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 +=
                          main.h

                          @

                          1 Reply Last reply
                          0
                          • K Offline
                            K Offline
                            kuheylan
                            wrote on 12 Dec 2011, 16:18 last edited by
                            #13

                            anybody help me. it is very important for me

                            1 Reply Last reply
                            0
                            • K Offline
                              K Offline
                              kuheylan
                              wrote on 12 Dec 2011, 16:55 last edited by
                              #14

                              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!!

                              1 Reply Last reply
                              0
                              • R Offline
                                R Offline
                                Rahul Das
                                wrote on 12 Dec 2011, 17:30 last edited by
                                #15

                                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.


                                Declaration of (Platform) independence.

                                1 Reply Last reply
                                0
                                • K Offline
                                  K Offline
                                  kuheylan
                                  wrote on 12 Dec 2011, 17:37 last edited by
                                  #16

                                  in console application! ...

                                  1 Reply Last reply
                                  0
                                  • R Offline
                                    R Offline
                                    Rahul Das
                                    wrote on 12 Dec 2011, 17:40 last edited by
                                    #17

                                    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]


                                    Declaration of (Platform) independence.

                                    1 Reply Last reply
                                    0
                                    • K Offline
                                      K Offline
                                      kuheylan
                                      wrote on 12 Dec 2011, 17:44 last edited by
                                      #18

                                      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

                                      1 Reply Last reply
                                      0
                                      • A Offline
                                        A Offline
                                        andre
                                        wrote on 12 Dec 2011, 17:45 last edited by
                                        #19

                                        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?

                                        1 Reply Last reply
                                        0
                                        • A Offline
                                          A Offline
                                          andre
                                          wrote on 12 Dec 2011, 17:48 last edited by
                                          #20

                                          [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.

                                          1 Reply Last reply
                                          0

                                          10/21

                                          12 Dec 2011, 15:54

                                          • Login

                                          • Login or register to search.
                                          10 out of 21
                                          • First post
                                            10/21
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved