[Insight-users] itk vtk and cocoa

Sean McBride sean at rogue-research.com
Wed Oct 29 11:06:14 EDT 2008


Please keep the discussion on the list.

I work on a similar application and have no such problems.

Which compiler?  Which version of ITK?  I have success with gcc 4.2 and
ITK 3.8/CVS.  Do you have a simple test case showing the error, for us to try?

Sean


On 10/29/08 3:42 PM, alexandre govignon said:

>The application that i build is an objective-C application (cocoa
>document based application) when i include itk headers, the compiler
>presents error, due to template class of itk...
>I follow the instruction of that tutorial, who works for VTK.
>
>http://www.macresearch.org/cocoa_for_scientists
>
>tutorials number: 14,15 et 16
>
>
>The only problem that i have is to include itk headers.
>
>2008/10/29 Sean McBride <sean at rogue-research.com>:
>> 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.




More information about the Insight-users mailing list