[Insight-users] Help with compilation issue: expected class-name before '{' token

Martin Kavec kavec at messi.uku.fi
Wed Apr 26 03:25:39 EDT 2006


Absolutely, Stefan.

Thanks a lot,

Martin

On Wed, 26 Apr 2006, Stefan Klein wrote:

> Hi Martin,
>
> I think you forgot the template argument:
>
> template< class TSpatialObject >
> class ITK_EXPORT TanimotoSpatialObjectSimilarityCoefficient : public 
> SpatialObjectSimilarityCoefficient {
>
> should probably be:
>
> template< class TSpatialObject >
> class ITK_EXPORT TanimotoSpatialObjectSimilarityCoefficient :
>  public SpatialObjectSimilarityCoefficient< TSpatialObject >
> {
>
>
>
> Regards,
> Stefan
>
>
>
>
>
> At 01:36 26/04/06, you wrote:
>> Hi,
>> 
>> I would very much appreciate if some could help me with compilation problem 
>> I
>> have. Perhaps it's a bit late (2.30 am) and I am not able find out myself,
>> where is the issue.
>> 
>> I use Gentoo linux, gcc-3.4.5 and ITK-2.6.0. I set up a project, where I
>> define a class A (inheriting from itkObject) and class B (inheriting from 
>> A).
>> In this configuration I am not able to compile a test file for B. If I
>> implement everything in A, the code compiles.
>> 
>> Here is the compiler output:
>> 
>> c++ -ftemplate-depth-50 -g -I/opt/ITK_debug/Utilities/vxl/core
>> -I/opt/ITK_debug/Utilities/vxl/vcl -I/opt/ITK-2.6.0/Utilities/vxl/core
>> -I/opt/ITK-2.6.0/Utilities/vxl/vcl -I/opt/ITK-2.6.0/Utilities
>> -I/opt/ITK_debug/Utilities -I/opt/ITK_debug/Utilities/gdcm
>> -I/opt/ITK-2.6.0/Utilities/nifti/znzlib
>> -I/opt/ITK-2.6.0/Utilities/nifti/niftilib -I/opt/ITK-2.6.0/Utilities/expat
>> -I/opt/ITK_debug/Utilities/expat -I/opt/ITK_debug/Utilities/DICOMParser
>> -I/opt/ITK-2.6.0/Utilities/DICOMParser -I/opt/ITK-2.6.0/Utilities/NrrdIO
>> -I/opt/ITK-2.6.0/Utilities/MetaIO -I/opt/ITK-2.6.0/Code/SpatialObject
>> -I/opt/ITK-2.6.0/Code/Numerics/NeuralNetworks
>> -I/opt/ITK-2.6.0/Code/Numerics/Statistics 
>> -I/opt/ITK-2.6.0/Code/Numerics/FEM
>> -I/opt/ITK-2.6.0/Code/IO -I/opt/ITK-2.6.0/Code/Numerics
>> -I/opt/ITK-2.6.0/Code/Common -I/opt/ITK-2.6.0/Code/BasicFilters
>> -I/opt/ITK-2.6.0/Code/Algorithms -I/opt/ITK_debug -ggdb -Wall -o
>> CMakeFiles/itkTanimotoSpatialObjectSimilarityCoefficient.dir/itkTanimotoSpatialObjectSimilarityCoefficient.o 
>> -c 
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.cxx
>> In file included
>> from 
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.cxx:21:
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:29: 
>> error: expected class-name before '{' token
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:34: 
>> error: `SpatialObjectSimilarityCoefficient' does not name a type
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:44: 
>> error: `Superclass' has not been declared
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:44: 
>> error: expected nested-name-specifier before "CoefficientType"
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:44: 
>> error: `CoefficientType' does not name a type
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:46: 
>> error: `Superclass' has not been declared
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:46: 
>> error: expected nested-name-specifier before "SpatialObjectType"
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:46: 
>> error: `SpatialObjectType' does not name a type
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:47: 
>> error: `Superclass' has not been declared
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:47: 
>> error: expected nested-name-specifier before "PixelType"
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:47: 
>> error: `PixelType' does not name a type
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:48: 
>> error: `Superclass' has not been declared
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:48: 
>> error: expected nested-name-specifier before "Pointer"
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:48: 
>> error: `Pointer' does not name a type
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:49: 
>> error: `Superclass' has not been declared
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:49: 
>> error: expected nested-name-specifier before "ConstPointer"
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:49: 
>> error: `ConstPointer' does not name a type
>> /home/kavec/Projects/itkSpatialObjectSimilarityCoefficient/itkTanimotoSpatialObjectSimilarityCoefficient.h:51: 
>> error: expected `,' or `...' before '*' token
>> 
>> I also attach the sources and CMakeList.txt.
>> 
>> Thanks in advance.
>> 
>> Martin
>> 
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>
>
>
>
>


More information about the Insight-users mailing list