the application has requested the runtime to terminate it in an unusual way qt c++ [closed]

asked Mar 8 '14

zowpro gravatar image

updated Mar 12 '14

Hello,

What does it mean that you display this message "the application has requested the runtime to terminate it in an unusual way" after inserting a correct program in Qt creator C + +. image description Thanks

EDIT 1:

I did the translation of contour points (about 300-1000 poitns) ie each point I changed its X and Y coordinates to move the vector XOY center of gravity with this formula:

for(i=1;i<contours.size();i++){ 
   contours_poly[0][i].x = contours_poly[0][i]..x-mc[1].x; 
   contours_poly[0][i].y = contours_poly[0][i]..y-mc[1].y; 
   contours_poly[1][i].x = contours_poly[1][i]x-mc[1].x; 
   contours_poly[1][i].y = contours_poly[1][i].y-mc[1].y; 
} // mc[1].x and mc[1].y are the coordinate of center of gravity

But I do not know if the bug is generated by the modification of a large number of points or what is the formula that is false. thank you

Preview: (hide)

Closed for the following reason the question is answered, right answer was accepted by StevenPuttemans
close date 2014-03-14 02:18:09.020103

Comments

1

bad_alloc.. you ran out of memory ?

berak gravatar imageberak (Mar 9 '14)edit
1

Probably you made an error in your code. Please give us some more information to get you the help needed ...

StevenPuttemans gravatar imageStevenPuttemans (Mar 10 '14)edit
1

Please use the 'edit' button, it is there for a reason. Don't add other problems or explanations in an answer. Deleted and added it to the question myself.

StevenPuttemans gravatar imageStevenPuttemans (Mar 12 '14)edit
1

hi @zowpro, you confused the indices in the code above. it's : contours_poly[ contour_id ][ point_id ].

  • i goes over contours, but you use it as point index
  • you access contours_poly[0] and contours_poly[1] without checking, if there are (enough ) contours at all
  • you can't use 2 different contours in the same loop with the same indices, they will have different sizes
berak gravatar imageberak (Mar 12 '14)edit
1

Thanks guys, i resolved my problem

zowpro gravatar imagezowpro (Mar 12 '14)edit