Problems when converting to latest opencv version

Hi,
Im trying to convert an older opencv project to the latest (4.5.2) version. I get the following 3 problems.

1: CV_TERMCRIT_EPS and CV_TERMCRIT_ITER are undefined

2: There is something strange going on with this try-catch

3: This AutoLock gives a problem

See the pictures:

please, no useless screenshots of code or errors here.
replace with TEXT , thank you.

you already stated that you understand that you’re porting older code.

you stated three problems.

you don’t have a concrete question.

it seems that you don’t know how to deal with those problems.

you should present your own effort into at least understanding those problems.

I hoped somebody would recognize one of the problems and give me advice how to solve it. Isn’t this forum to help people? Yes I always try to solve it myself first. But I seemed to be stucked with these ones.
And I assumed that pictures say much more then words. Maybe more experienced users get additional info this way because of the information around it.

he wasn’t asking for prose. he was asking you to copy the text that’s in the pictures. you know why? that allows search engines to find this thread and help others.

anyway, let’s work on the first point: termination criteria.

read OpenCV documentation for the function cornerSubPix, which uses those things in your code.

then you figure out what needs to be changed. you can guess and try.

report back with what you’ll have tried and what exact results you got.

we can help you a lot but we won’t do your work for you.