[Insight-users] itk vtk and cocoa

Mathieu Coursolle mcoursolle at rogue-research.com
Wed Oct 29 09:50:47 EDT 2008


Hi,

We are using VTK and ITK in a Cocoa application without any problems.

Here is an example on how we include the headers, maybe it will help  
you...

Make sure the file you include itk headers in are .mm.

If you want to see our settings:
http://www.cdash.org/CDash/buildSummary.php?buildid=205389

Thanks.

Mathieu

// Include all the itk headers used, then this file can be used like a  
framework include
#ifdef __cplusplus

	// Define undefined constant to avoid warnings.
	#define ITK_TEMPLATE_CXX 0
	#define ITK_TEMPLATE_TYPE 0
	
	#include "itkImage.h"

#endif

On 29-Oct-08, at 8:47 AM, alexandre govignon wrote:

> Hi all
> 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
>
> if somebody can help me...
>
> Regards,
> Alexandre
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20081029/26b30d63/attachment.htm>


More information about the Insight-users mailing list