[Insight-users] Namespaces Problem

martin.garcia@epfl.ch martin . garcia at epfl . ch
Wed, 21 Aug 2002 11:45:43 +0200


Hi ,

I'm working with VC++6.0 (sp 6), and I'm trying to integrate itk 
functionalities to my project, but when I use namespaces, I always have the 
following compilation error

Sample Code

// VtkItkConnector.cpp: implementation of the CVtkItkConnector class.
//
//////////////////////////////////////////////////////////////////////
#include <itkImage.h>
#include <itkCommand.h>
#include <itkVTKImageExport.h>
#include <itkVTKImageImport.h>
#include <itkPNGImageIO.h>


#include "stdafx.h"
#include "osirislight.h"
#include "VtkItkConnector.h"
#include "vtkImageData.h"
#include "vtkImageExport.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CVtkItkConnector::CVtkItkConnector(vtkImageData* data)
{
	m_pImageData=data;
	vtkImageExport* vtkExporter=vtkImageExport::New();
	vtkExporter->SetInput(m_pImageData);

	//VTK to ITK Pipeline connection

-->>>>>	typedef itk::Image<float,2> ImageType;
	//typedef itk::VTKImageImport<ImageType> ImageImportType;

}

CVtkItkConnector::~CVtkItkConnector()
{
	m_pImageData->Delete();
}


Compilation

Compiling...
VtkItkConnector.cpp
D:\OsirisTools\OsirisLight\OsirisLightNew\VtkItkConnector.cpp(35) : error 
C2653: 'itk' : is not a class or namespace name
D:\OsirisTools\OsirisLight\OsirisLightNew\VtkItkConnector.cpp(35) : error 
C2143: syntax error : missing ';' before '<'
D:\OsirisTools\OsirisLight\OsirisLightNew\VtkItkConnector.cpp(35) : error 
C2143: syntax error : missing ';' before '<'
Error executing cl.exe.

OsirisLight.exe - 3 error(s), 0 warning(s)



Does anybody know how to solve the problem(i.e. make VC++ accept the 
namespaces)?


Thanks,

Martin


-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/