[Insight-users] ITK_TYPENAME
Luis Ibanez
luis.ibanez at kitware.com
Thu Sep 2 18:07:54 EDT 2004
Hi Mike,
ITK_TYPENAME is defined in
Insight/Code/Common/itkWin32Header.h
in lines 74-80
This typedef was introduced in order to deal
with inconsistencies between several compilers
regarding the use of typename in the default
arguments of template parameters.
The fact that your compiler is not finding this
symbol may indicate one (or both) of the following
things:
A) _MSC_VER is not being defined or is > 1310
B) your code is not including tikWin32Header.h
(A) is much more likely to be happening than (B).
You should NOT do
#define typename ITK_TYPENAME
that will be catastrophic !!!
(I hope that's just a typo in your email).
You probably should try making just
#define ITK_TYPENAME
since VC++ 6.0 just don't know nor care about
the "typename" keyword.
The real solution to your problem will be to figure
out if itkWin32Header.h is being included or not.
Regards,
Luis
------------------------
Michael Hardisty wrote:
> Hello ITK,
> I have been working on creating dll libraries that
> plug into a program for visualization and processing (Amira), as such I
> am not using CMake to manage my build process as the program has its own
> custom build that it must perform (I am not really sure what dire
> implacations may result). I am trying to create a registration method
> using the ITK registration frame work available and am generating build
> errors. The first build error that I got was ITK_TYPENAME...undeclared
> identifier. I got rid of this error with: #define typename
> ITK_TYPENAME. I do have a very simple plugin working with this I am not
> sure if this is what I should be doing but I found a similar problem in
> the mail-list so I gave it a try. It got rid of those undeclared
> identifier errors with the simple plugin but with a larger plugin I have
> more build errors but it generated problems in *.txx files again around
> the ITK_TYPENAME. The errors originate from lines that contain
> ITK_TYPENAME and state that: "typename cannot be used outside a template
> declaration". This turn of events leads me to believe that there is
> more to ITK_TYPENAME than simply defining it as typename. Any
> assistance with this matter would be greatly appreciated. For reference
> I am running ITK on Windows 2000, VC++6. For error messages please see
> below.
>
> Mike
>
> 1st set of error messages
>
> c:\itk\insighttoolkit-1.6.0\code\common\itkinterpolateimagefunction.h(44)
> : error C2065: 'ITK_TYPENAME' : undeclared identifier
>
> c:\itk\insighttoolkit-1.6.0\code\common\itkinterpolateimagefunction.h(129)
> : see reference to class template instantiation
> 'itk::InterpolateImageFunction<TInputImage,TCoordRep>' being compiled
> c:\itk\insighttoolkit-1.6.0\code\common\itkinterpolateimagefunction.h(44)
> : error C2143: syntax error : missing ',' before 'tag::id'
>
> c:\itk\insighttoolkit-1.6.0\code\common\itkinterpolateimagefunction.h(129)
> : see reference to class template instantiation
> 'itk::InterpolateImageFunction<TInputImage,TCoordRep>' being compiled
> c:\itk\insighttoolkit-1.6.0\code\common\itkconceptchecking.h(318) :
> error C2653: 'Detail' : is not a class or namespace name
> c:\itk\insighttoolkit-1.6.0\code\common\itkconceptchecking.h(328)
> : see reference to class template instantiation 'Signed<T>' being compiled
>
> 2nd set of error messages
>
> c:\itk\insighttoolkit-1.6.0\code\spatialobject\itkspatialobject.txx(578)
> : error C2899: typename cannot be used outside a template declaration
> c:\program files\microsoft visual
> studio\vc98\include\xstring(583) : while compiling class-template member
> function 'bool __thiscall
> itk::SpatialObject<1>::ComputeBoundingBox(void) const'
> c:\itk\insighttoolkit-1.6.0\code\spatialobject\itkspatialobject.txx(588)
> : error C2899: typename cannot be used outside a template declaration
> c:\program files\microsoft visual
> studio\vc98\include\xstring(583) : while compiling class-template member
> function 'bool __thiscall
> itk::SpatialObject<1>::ComputeBoundingBox(void) const'
> c:\program files\microsoft visual studio\vc98\include\ostream(354) :
> fatal error C1076: compiler limit : internal heap limit reached; use /Zm
> to specify a higher limit
>
More information about the Insight-users
mailing list