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

Bill Hoffman bill.hoffman@kitware.com
Thu, 01 Mar 2001 10:32:24 -0500


You should not include windows.h and mesh.   I
have created a new file called itkWindows.h, if you include
that instead of windows.h it will get rid of the problem.


At 10:36 AM 3/1/2001 -0500, Luis Ibanez wrote:
>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
>______________________________________________________________________
>
>_______________________________________________
>Insight-developers mailing list
>Insight-developers@public.kitware.com
>http://public.kitware.com/mailman/listinfo/insight-developers