[Insight-users] Errors with templates with gcc 4.1.3

J.S.Wijnhout at lumc.nl J.S.Wijnhout at lumc.nl
Mon Feb 25 05:16:47 EST 2008


Hi,

 

You probably have to use the "typename" keyword:

typedef typename itk::VTKImageExport<ImageType>::Pointer
ExportFilterPointer;

I'm not sure, but many of my template errors go away after inserting the
typename keyword at the appropriately place. What is appropriate depends
on the compiler though.

 

best,

Jeroen

 

________________________________

From: insight-users-bounces+j.s.wijnhout=lumc.nl at itk.org
[mailto:insight-users-bounces+j.s.wijnhout=lumc.nl at itk.org] On Behalf Of
Anja Ende
Sent: Monday, February 25, 2008 11:12 AM
To: insight-users at itk.org
Subject: [Insight-users] Errors with templates with gcc 4.1.3

 

Hi everyone,

I am having problems with compiling the following bit of code:

Say I have a class declaration as follows:

class ITK2VTK
{
public:
                template<typename T>
                void Test()
                {
                    typedef itk::Image<T, 3> ImageType;
                    typedef itk::VTKImageExport<ImageType>
ExportFilterType;
                    // The following line gives the error.
                    typedef itk::VTKImageExport<ImageType>::Pointer
ExportFilterPointer;
                    
                    ExportFilterType::Pointer ExportFilterPointer;
                    ExportFilterPointer itkExporter =
ExportFilterType::New();
                }
};

The line:  typedef itk::VTKImageExport<ImageType>::Pointer
ExportFilterPointer; fails with the following error:

error: too few template-parameter-lists

Doing a search on the Internet yielded people with the same problems but
with static class members. However, I do not have any static definitions
here...

Anyone has any idea what is happening here?
 
Cheers,

Anja 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20080225/a8b0e7cc/attachment.htm


More information about the Insight-users mailing list