I am trying to run the squares.cpp example in the openCV 2.2. The code compiles and builds without errors in Visual Studio 2008. However when I run the executable (i.e., during run time) I am getting a error stating
Unhandled exception at 0x004ac363 in OpenCVRectangle.exe: 0xC0000005: Access violation reading location 0xcccccccc.
This occurs at the definition:
vector<vector<Point> > squares;
in the main function
Can somebody help, why this occurs? I figured out that the value 0xcccccc usually is an uninitialized or bad variable, but do not understand why I get this exception at this line.
The full example code can be found at http://pastebin.com/MTaXVcQz