[Insight-users] ITK iterators debugging problem in Visual Studio 8(VS 2005)

zjzhang at ee.cuhk.edu.hk zjzhang at ee.cuhk.edu.hk
Mon Nov 5 07:36:29 EST 2007


Dear All:

      I have a problem with my own program. I use vs 2005 , itk 3.4
version under windows xp. it happens with the debug mode of the
program with the following code:
               ImageFileReader::Pointer fixedReader = ImageFileReader::New();
               fixedReader->SetFileName( filename );
               fixedReader->Update();

 every time when I call update() of the imagefilereader, there will be
an error:
Unhandled exception at 0x005ace01 in MyProgram.exe: 0xC0000005: Access
violation reading location 0xcccccccc.

and the debug breaks at file "list" with lines:
#if _HAS_ITERATOR_DEBUGGING || _SECURE_SCL
       iterator begin()
               {       // return iterator for beginning of mutable sequence
               return (iterator(_Nextnode(_Myhead), this));
               }

I have seen there is a similar problem in:
http://www.itk.org/pipermail/insight-users/2006-December/020472.html
but It seem the discussion didn't reach a clear answer.
if I add # cmakedefine  _HAS_ITERATOR_DEBUGGING=0
         # cmakedefine  _SECURE_SCL=0
into the itkConfigure.h.in, line 49, it seems after cmake, it is still
not defined in the itkconfigure.h file.
But if I add some words in cmakelist.txt, I wonder if I need add
_HAS_ITERATOR_DEBUGGING=0 every time in my program build on itk.

I want to know how to solve this bug.  Thank you for your help.

regards,
Alex


More information about the Insight-users mailing list