Always include only compatible debug libraries:
I came here because Visual Studio 2010 did not display debugging information for some local variables in the opensv 2.4.2 library. In Mat _InputArray::getMat(int i) const I had to see several variables, but k and vv were missing. (and I got an exception in cv::_interlockedExchangeAdd when getMat (mistakenly) returns only empty matrices.) In any case, the problem was that I included (as a library in PATH for DLLs and as #pragma comment ) as debug libraries , and release libraries. This seems to have caused the problem. Everything worked well after including only debug libraries.
source share