[Insight-developers] itkMesh GetClassName() and windows.h

Luis Ibanez ibanez@cs.unc.edu
Thu, 01 Mar 2001 10:36:19 -0500


Hi,

I've found the following problem on WinNT:

Using itkMesh in a larger application mixed
with other non-itk classes.

It happens that if you include :

  #include <windows.h>
  #include <itkMesh.h>

in this order,

and declare a variable of type itkMesh,
the calls to  GetPoints() generate the following error
concerning   GetClassName() :

------------------- error message -----------------------------
:\usr\ibanez\src\insightalpha\insight\code\common\itkmesh.txx(78) :
error C2039: 'GetClassName' : is not a member of 'Mesh<float,class
itk::DefaultStaticMeshType<float,3,3,double,double> >'
        h:\microsoft visual studio\vc98\include\xstring(583) : while
compiling class-template member function 'class itk::SmartPointer<class
itk::VectorContainer<unsigned long,class itk::Point<double,3> > >
__thiscall itk::Mesh<float,class itk::Defa
ultStaticMeshType<float,3,3,double,double> >::GetPoints(void)'
h:\usr\ibanez\src\insightalpha\insight\code\common\itkmesh.txx(78) :
error C2039: 'GetClassName' : is not a member of 'Mesh<float,class
itk::DefaultStaticMeshType<float,3,3,double,double> >'
        h:\microsoft visual studio\vc98\include\xstring(583) : while
compiling class-template member function 'class itk::SmartPointer<class
itk::VectorContainer<unsigned long,class itk::Point<double,3> > >
__thiscall itk::Mesh<float,class itk::Defa
ultStaticMeshType<float,3,3,double,double> >::GetPoints(void)'
Error executing cl.exe.

------------------ end error message -------------------------------

But, if  the order of includes are revesed, like:

#include <itkMesh.h>
#include <windows.h>

The code compiles fine.

Looks like some definitions on   windows.h
obscures the Macro declaration of itkTypeMacro.

I cannont avoid the inclusion of  "windows.h" because 
it is buried nested in includes from other package (FLTK)
from which I'm deriving classes.



Is there something we can do about it ?



Thanks


Luis







--
______________________________________________________________________

Luis Ibanez
Research Assistant Professor - Division of Neurosurgery
University of North Carolina at Chapel Hill
CB# 7060, Chapel Hill, NC 27599
email : ibanez@cs.unc.edu       home  : http://www.cs.unc.edu/~ibanez
phone : (919)-843-9961          fax   : (919)-966-6627
______________________________________________________________________