Hi,

I'm having a problem when i tried to execute my program.. I have met the same problem before and i can solve it. My problem before is some kind of missing .dll.. But now, i don't know what kind of problem is this.. I know this is an access violation, but i just don't know where.. Could you please help me ?
Here is my code and the debugger result..

Qt Code:
  1. #include "opencv/cv.h"
  2. #include "opencv/highgui.h"
  3. #include "opencv2/opencv.hpp"
  4. #include "stdio.h"
  5. #include <opencv/cvaux.h>
  6. #include <opencv/cxcore.h>
  7.  
  8. int main(int argc, char **argv)
  9. {
  10. CvCapture capture1;
  11. IplImage *frame;
  12.  
  13. double t,ms = 0;
  14. int key = 0;
  15.  
  16. capture1 = cvCaptureFromFile("chi-tabaywatch.avi");
  17. cvNamedWindow("JCXSUPERTAMARK5",1);
  18.  
  19. while (key != 'q')
  20. {
  21. t = (double)cvGetTickCount();
  22.  
  23. frame = cvQueryFrame(capture1);
  24. cvShowImage("JCXSUPERTAMARK5",frame);
  25. key = cvWaitKey(1);
  26.  
  27. t = (double)cvGetTickCount() -t;
  28. ms += t / ((double)cvGetTickFrequency() * 1000.0);
  29.  
  30. if (ceil(ms) >= 1000)
  31. {
  32. cvSaveImage("img.jpg",frame);
  33. ms = 0;
  34. }
  35. }
  36.  
  37. cvReleaseCapture(capture1);
  38. cvDestroyWindow("JCXSUPERTAMARK5");
  39.  
  40. return 0;
  41. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. Dump of assembler code from 0x9cfffe to 0x9d0076:
  2. 0x009cfffe: add %al,(%eax)
  3. 0x009d0000: add %al,0x0(%eax)
  4. 0x009d0003: add %al,(%ecx)
  5. 0x009d0005: add %al,(%eax)
  6. 0x009d0007: add %ah,%dl
  7. 0x009d0009: add %eax,(%eax)
  8. 0x009d000b: add %cl,(%edi)
  9. 0x009d000d: add %eax,(%eax)
  10. 0x009d000f: add %ah,0x5a(%esi)
  11. 0x009d0012: pop %es //here is where the arrow pointing at//
  12. 0x009d0013: add %dl,0x22(%ebp)
  13. 0x009d0016: add $0x0,%al
  14. 0x009d0018: push %esi
  15. 0x009d0019: add $0x3000000,%eax
  16. 0x009d001e: add %al,(%eax)
  17. 0x009d0020: and %al,(%eax)
  18. 0x009d0022: add %al,(%eax)
  19. 0x009d0024: add %eax,(%eax)
  20. 0x009d0026: add %al,(%eax)
  21. 0x009d0028: (bad)
  22. 0x009d0029: (bad)
  23. 0x009d002a: (bad)
  24. 0x009d002b: incl (%eax)
  25. 0x009d002d: add %al,(%eax)
  26. 0x009d002f: add %bh,%bh
  27. 0x009d0031: (bad)
  28. 0x009d0032: (bad)
  29. 0x009d0033: lcall *0x2400007e(%ecx)
  30. 0x009d0039: add %al,(%eax)
  31. 0x009d003b: add %ah,(%eax,%eax,1)
  32. 0x009d003e: add %al,(%eax)
  33. 0x009d0040: xor (%eax),%eax
  34. 0x009d0042: add %al,(%eax)
  35. 0x009d0044: pusha
  36. 0x009d0045: add %al,(%eax)
  37. 0x009d0047: add %ah,0x0(%eax)
  38. 0x009d004a: add %al,(%eax)
  39. 0x009d004c: add %al,(%eax)
  40. 0x009d004e: add %al,(%eax)
  41. 0x009d0050: sbb %al,(%eax)
  42. 0x009d0052: add %al,(%eax)
  43. 0x009d0054: add %al,(%eax)
  44. 0x009d0056: add %al,(%eax)
  45. 0x009d0058: add %al,(%eax)
  46. 0x009d005a: add %al,(%eax)
  47. 0x009d005c: add %al,(%eax)
  48. 0x009d005e: add %al,(%eax)
  49. 0x009d0060: add %al,(%eax)
  50. 0x009d0062: add %al,(%eax)
  51. 0x009d0064: pop %es
  52. 0x009d0065: js 0x9d0067
  53. 0x009d0067: add %bh,(%eax,%eax,1)
  54. 0x009d006a: add %al,(%eax)
  55. 0x009d006c: push %esi
  56. 0x009d006d: add $0x3000000,%eax
  57. 0x009d0072: add %al,(%eax)
  58. 0x009d0074: add %eax,(%eax)
  59. End of assembler dump.
To copy to clipboard, switch view to plain text mode