PDA

View Full Version : Runtime error while executing a project



bajoelkid12
9th June 2011, 07:36
Hello everybody.. .

i've got a problem when compiling my project

Here is my error message.

C:\Qt\2010.05\qt\mamayoquiero-build-desktop\release\mamayoquiero.exe exited with code -1073741515

Here is my code,



#include "opencv/cv.h"
#include "opencv/highgui.h"
#include "opencv2/opencv.hpp"


int main(int argc, char **argv)
{
CvCapture *capture;
IplImage *frame;

double t,ms = 0;
int key;

/* MURUPKAN KAMERANYA */
capture = cvCaptureFromCAM(0);
cvNamedWindow("video",1);

while (key != 'q')
{
t = (double)cvGetTickCount();


/* TAMPILKAN VIDEONYA */
frame = cvQueryFrame(capture);
cvShowImage("video",frame);
key = cvWaitKey(1);

/* DAPATKAN ELAPSED TIME */
t = (double)cvGetTickCount() -t;
ms += t / ((double)cvGetTickFrequency() * 1000.0);

/* OTOMATIS MENYIMPAN 3 DETIK SEKALI */
if (ceil(ms) >= 3000)
{
cvSaveImage("img.jpg",frame);
ms = 0;
}
}

/* BEBASKAN MEMORI */
cvReleaseCapture(&capture);
cvDestroyWindow("video");

return 0;
}



In your opinion, why this is happening ? is it because i don't use any Qt Classes ?
thank you.

Added after 58 minutes:

hey i have solved the error by including stdio.h :)

but then, when i compile this project, another warning occured.

'key' is used uninitialized in this function.

what does this warning mean ? and how can i solve it ?

Added after 13 minutes:

ahh.. i can solve the previous warning by un-including the opencv.hpp :)

but still i can't compile it, this error message occured :

C:\Qt\2010.05\qt\mamayoquiero-build-desktop\release\mamayoquiero.exe exited with code -1073741515

i have googled about this error message, but still i can't find the explanation. :)

Any advice ?

joyer83
9th June 2011, 09:55
Maybe the opencv code calls exit() (http://www.cplusplus.com/reference/clibrary/cstdlib/exit/) prematurely. Try adding a breakpoint to the exit()-function and see if someone is calling it.
Could be also some unhandled exception that has been thrown.

ChrisW67
9th June 2011, 23:27
In your opinion, why this is happening ?
In my opinion, the error number is meaningful.

Search this forum for "-1073741515" and you will find it a few times, usually with the same solution. Also, -1073741515 = 0xC0000135: If you Google that (http://lmgtfy.com/?q=0xc0000135) you will find that it means that the program failed to initialise, i.e. it isn't even loading. Make sure everything it needs in the way of dynamically loaded libraries are available (probably missing OpenCV). If you don't know what is missing try using Depends.exe.

but still i can't compile it, this error message occured :
C:\Qt\2010.05\qt\mamayoquiero-build-desktop\release\mamayoquiero.exe exited with code -1073741515

You have compiled it. The error message is a run time error, not a compile or link error.

'key' is used uninitialized in this function.
what does this warning mean ? and how can i solve it ?
It means exactly what it says. As far as the compiler can tell the first time you use the variable "key" is before you ever assign it a value. You fix it by making sure all variables are given an initial value before you try to use them in other ways.


is it because i don't use any Qt Classes ?
No, that is the reason this question doesn't belong in a Qt forum.

bajoelkid12
10th June 2011, 03:53
thanks a lot for your answer chris.. but i still don't know what is missing ??? how can i use depends.exe ?

ChrisW67
10th June 2011, 04:45
Google for it. Download it. Run it. Open your executable with it. Look at the list of dependencies it cannot find.