Ask Your Question
0

Unhandled exception in Release version of Feature Detection and Feature Matching with FLANN

asked 2017-08-10 09:54:56 -0600

John Duke gravatar image

Hello folks,

I have OpenCV 3.2.0 installed on VS2017 CE. I built and compiled the tutorials on Feature Detection and Feature Matching with FLANN using code from http://docs.opencv.org/master/d7/d66/... and http://docs.opencv.org/master/d5/d6f/....

The debug version of the .exe files run successfully. However, the release version of both programs crash with the following warning:

Unhandled exception at 0x00007FFAF4DE3159 (opencv_xfeatures2d320d.dll) in flann.exe: 0xC0000005: Access violation writing location 0x000000000000001C. occurred

Please can anyone tell me how to fix this? Thanks

edit retag flag offensive close merge delete

Comments

did you build the opencv libs locally ? (afaik, the prebuild libs are for vs2015 only)

berak gravatar imageberak ( 2017-08-10 10:13:59 -0600 )edit
1

Yes. I built the opencv libs locally using source files from GitHub. Thanks!

John Duke gravatar imageJohn Duke ( 2017-08-10 10:24:05 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2017-08-10 11:06:35 -0600

berak gravatar image

updated 2017-08-10 11:08:35 -0600

you say: release version , but the msg is from a debug dll. please make sure to strictly use release libs with release build, and debug libs (with d at the end) with debug build

edit flag offensive delete link more

Comments

Thanks! I think the release build inherited the debug dll. I have removed those and replaced with the release lib. However, I get the following error message:

opencv_core320.lib(matrix.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in Source.obj 1>opencv_core320.lib(matrix.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in Source.obj 1>opencv_core320.lib(alloc.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in Source.obj

John Duke gravatar imageJohn Duke ( 2017-08-10 12:07:25 -0600 )edit

those are all things, that only should exist in a DEBUG build.

again, it's not your code, but your project is somewhat broken. (maybe start from scratch with an absolute empty one ?)

berak gravatar imageberak ( 2017-08-10 12:11:45 -0600 )edit

^^ oh, wait, that seems to be just the opposite version - debug build and release libs

berak gravatar imageberak ( 2017-08-10 12:31:11 -0600 )edit

I will rebuild it from scratch. The last errors are from the release build

John Duke gravatar imageJohn Duke ( 2017-08-10 16:26:53 -0600 )edit
0

answered 2017-08-13 04:33:05 -0600

John Duke gravatar image

I discovered some files in the release library were missing so I rebuilt OpenCV 3.2.0 using the master and opencv_contrib source files. However, they were still missing after the rebuild.

I had to build OpenCV 3.3.0 using the master and opencv_contrib files. After linking the library, I can build the same code in both debug and release modes.

Thanks for your help!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-08-10 09:54:56 -0600

Seen: 228 times

Last updated: Aug 13 '17