[Insight-users] itk vtk and cocoa

Sean McBride sean at rogue-research.com
Wed Oct 29 10:28:01 EDT 2008


On 10/29/08 1:47 PM, alexandre govignon said:

>i tried to use vtk with cocoa. It works well. But i would like to use
>ITK too. And it causes troubles. Definitely the problem comes from
>templates in ITK which is not accepted by the objective-C language.
>I include itk headers like that:
>
>
>#define id Id
>#import "vtkRenderer.h"
>#import "itkImage.h"
>#undef id
>
>The third line cause me lots of error due to template language:
>
>such as:
>
>/Users/alex/Dev/ITKB/include/InsightToolkit/Common/itkNumericTraits.h:48:
>error: expected template-name before '<' token

Unlike VTK, ITK itself does not contain any Objective-C nor Cocoa, so
I'm surprised you have problems.

Why are you redefining 'id' (a reserved word in Obj-C)?

The public VTK and ITK headers do not use 'id' anywhere.  There is even
a unit test in ITK to ensure this.

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada




More information about the Insight-users mailing list