you need a DEBUG build of the opencv libs for that.
this is indeed the most interesting question here !
is there any chance, you made a mess in your VS project ?
opencv actually only requires c++11. what happens, if you restrict it to that (instead of c++17) ?