[Moved] "exited with code 0" error
-
wrote on 12 Dec 2011, 15:12 last edited by
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!!
-
wrote on 12 Dec 2011, 15:18 last edited by
Error 0 is the OK status code. Nothing to worry about. If you get something other than 0 back, you have a problem.
-
wrote on 12 Dec 2011, 15:31 last edited by
but I dont take result. how is ok?
-
wrote on 12 Dec 2011, 15:38 last edited by
It simply means your code returned with no (zero) errors.
-
wrote on 12 Dec 2011, 15:41 last edited by
are you seriously! I understand it. But I studying say that why don't I take a result? have you an answer
-
wrote on 12 Dec 2011, 15:46 last edited by
What is the result ,that you expect ?
-
wrote on 12 Dec 2011, 15:46 last edited by
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?
-
wrote on 12 Dec 2011, 15:51 last edited by
Firstly I'm sorry for my english. I expect that my camera will run. but it does not
-
wrote on 12 Dec 2011, 15:52 last edited by
@#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.
-
wrote on 12 Dec 2011, 15:54 last edited by
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.
-
wrote on 12 Dec 2011, 15:58 last edited by
sorry, my previous post wasn't timely.pls Ignore it.
-
wrote on 12 Dec 2011, 15:58 last edited by
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_bundleTEMPLATE = app
SOURCES += main.cpp
INCLUDEPATH +=C:/opencvbuild/install/include/opencv
INCLUDEPATH +=C:/opencvbuild/install/include/opencv2/highgui
INCLUDEPATH +=C:/opencvbuild/install/includeLIBS += C:/opencvbuild/install/bin/*.dll
HEADERS +=
main.h@
-
wrote on 12 Dec 2011, 16:18 last edited by
anybody help me. it is very important for me
-
wrote on 12 Dec 2011, 16:55 last edited by
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!!
-
wrote on 12 Dec 2011, 17:30 last edited by
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.
-
wrote on 12 Dec 2011, 17:37 last edited by
in console application! ...
-
wrote on 12 Dec 2011, 17:40 last edited by
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]
-
wrote on 12 Dec 2011, 17:44 last edited by
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
-
wrote on 12 Dec 2011, 17:45 last edited by
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?
-
wrote on 12 Dec 2011, 17:48 last edited by
[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/21