[Insight-users] ITK and iterators debugging in Visual Studio
8
Luis Ibanez
luis.ibanez at kitware.com
Sun Dec 31 09:28:57 EST 2006
Hi Matei,
When adding cmakedefine statements to itkConfigure.h.in,
they will only appear in the file
itkConfigure.h
that CMake generates in the Binary directory where you are
building ITK (and the install directory,... if you are
installing ITK after building it).
The symbol does not appear in the CMake configuration editor, and
it does not appear in the properties of Visual Studio IDE. This
is normal. It is actually part of the advantages of defining the
symbol in the itkConfigure.h.in file.
Since itkConfigure.h is included by almost all ITK files, the symbol
will be used all through your build.
For a simple verification you can try adding in your
code something like:
#ifndef _HAS_ITERATOR_DEBUGGING
#error ITERATOR_DEBUGING_NOT_DEFINED
#endif
Please let us know if you find an indication that the symbol does
not get defined correctly.
Thanks
Luis
---------------------
Matei Stroila wrote:
> I added
>
> # cmakedefine _HAS_ITERATOR_DEBUGGING=0
>
> to Insight/itkConfigure.h.in, line 49
>
> but I don't see it in the CMake configuration editor, neither in the
> Properties Window of the ITK projects. It does not look like they are
> using it.
>
> Also, for people intersted in using VS 2005, this define is also necessary:
> _SECURE_SCL=0
>
>
> Matei
>
> On 12/27/06, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>
>>
>> Hi Matei, Karthik
>>
>>
>> Thanks for tracking this issue.
>>
>>
>> Just for the record:
>>
>> a better place for adding definitions is the file:
>>
>>
>> Insight/itkConfigure.h.in
>>
>>
>> Where you could add the line 49:
>>
>>
>> cmakedefine _HAS_ITERATOR_DEBUGGING=0
>>
>>
>> The advantage of adding the definition here instead of the
>> CMakeLists.txt file is that in the itkConfigure.h file, the
>> definition is actually passed also to the projects that use
>> ITK, while the definitions in CMakeLists.txt are used only
>> while building ITK.
>>
>>
>>
>> Regards,
>>
>>
>>
>> Luis
>>
>>
>> ----------------------
>> Matei Stroila wrote:
>> > Thank you very much.
>> >
>> > I added -D_HAS_ITERATOR_DEBUGGING=0 in Insight\CMakeLists.txt :
>> >
>> > IF(WIN32)
>> > IF(NOT BORLAND)
>> > IF(NOT CYGWIN)
>> > IF(NOT MINGW)
>> > ADD_DEFINITIONS(
>> > -D_HAS_ITERATOR_DEBUGGING=0
>> > )
>> > ENDIF(NOT MINGW)
>> > ENDIF(NOT CYGWIN)
>> > ENDIF(NOT BORLAND)
>> > ENDIF(WIN32)
>> >
>> >
>> > Recompiled and my program runs fine in debug.
>> >
>> >> Please log this issue as an entry in the bug tracker.
>> >>
>> >
>> > Sure, I will do it now.
>> >
>> > Thanks,
>> >
>> > Matei
>> >
>>
>
More information about the Insight-users
mailing list