[Insight-developers] anybody help me out of this?
Ting Chen
chenting@graphics.cis.upenn.edu
Wed, 10 Jan 2001 13:10:30 -0600
This is a multi-part message in MIME format.
------=_NextPart_000_000C_01C07B06.B545E1D0
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_000D_01C07B06.B545E1D0"
------=_NextPart_001_000D_01C07B06.B545E1D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I post it again since there is no reponse:
I am trying to build a Filter class derive from the class =
itkFilterMeshToMesh.
(To make things more clear, I attached my header file.)
but when I complie the code, I got the following error message:
d:\insight\insight\code\common\itkfiltermeshtomesh.txx(32) : error =
C2995:
'FilterMeshToMesh<TInputMesh,TOutputMesh>::FilterMeshToMesh<TInputMesh,TO=
utp
utMesh>' : template function has already been defined
d:\insight\insight\code\common\itkfiltermeshtomesh.h(78) : see
declaration of
'FilterMeshToMesh<TInputMesh,TOutputMesh>::FilterMeshToMesh<TInputMesh,TO=
utp
utMesh>'
d:\insight\insight\code\common\itkfiltermeshtomesh.txx(44) : error =
C2995:
'SetInput' : template function has already been defined
d:\insight\insight\code\common\itkfiltermeshtomesh.h(69) : see
declaration of 'SetInput'
d:\insight\insight\code\common\itkfiltermeshtomesh.txx(62) : error =
C2995:
'GetInput' : template function has already been defined
d:\insight\insight\code\common\itkfiltermeshtomesh.h(74) : see
declaration of 'GetInput'
d:\insight\insight\code\common\itkfiltermeshtomesh.txx(75) : error =
C2995:
'GetInput' : template function has already been defined
d:\insight\insight\code\common\itkfiltermeshtomesh.h(75) : see
declaration of 'GetInput'
d:\insight\insight\code\common\itkfiltermeshtomesh.txx(87) : error =
C2995:
'PrintSelf' : template function has already been defined
d:\insight\insight\code\common\itkfiltermeshtomesh.h(82) : see
declaration of 'PrintSelf'
The code in itkFilterMeshToMesh.h (use SetInput as example):
typedef TInputMesh InputMeshType;
typedef typename InputMeshType::Pointer InputMeshPointer;
/**
* Set the mesh input of this process object.
*/
void SetInput(InputMeshType *input);
itkFilterMeshToMesh.txx :
template <class TInputMesh, class TOutputMesh>
void
FilterMeshToMesh<TInputMesh,TOutputMesh>
::SetInput(TInputMesh *input)
{
this->ProcessObject::SetNthInput(0, input);
}
It seems the complier think InputMeshType and TInputMesh are different.
So how to solve the problem?
Another question is: did any anybody try to include vnl_matrix object in
their class? I always got error messages when I tried to do so.
------=_NextPart_001_000D_01C07B06.B545E1D0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
I post it again since there is no=20
reponse:
I am trying to build a Filter class =
derive from=20
the class itkFilterMeshToMesh.
(To make things more clear, I =
attached my header=20
file.)
but when I complie the code, I got the following error=20
message:
d:\insight\insight\code\common\itkfiltermeshtomesh.txx(32) : =
error=20
C2995:
'FilterMeshToMesh<TInputMesh,TOutputMesh>::FilterMeshToMe=
sh<TInputMesh,TOutp
utMesh>'=20
: template function has already been=20
defined
=20
d:\insight\insight\code\common\itkfiltermeshtomesh.h(78) : =
see
declaration=20
of
'FilterMeshToMesh<TInputMesh,TOutputMesh>::FilterMeshToMesh&l=
t;TInputMesh,TOutp
utMesh>'
d:\insight\insight\code\common\itkfi=
ltermeshtomesh.txx(44)=20
: error C2995:
'SetInput' : template function has already been=20
defined
=20
d:\insight\insight\code\common\itkfiltermeshtomesh.h(69) : =
see
declaration of=20
'SetInput'
d:\insight\insight\code\common\itkfiltermeshtomesh.txx(62) =
: error=20
C2995:
'GetInput' : template function has already been=20
defined
=20
d:\insight\insight\code\common\itkfiltermeshtomesh.h(74) : =
see
declaration of=20
'GetInput'
d:\insight\insight\code\common\itkfiltermeshtomesh.txx(75) =
: error=20
C2995:
'GetInput' : template function has already been=20
defined
=20
d:\insight\insight\code\common\itkfiltermeshtomesh.h(75) : =
see
declaration of=20
'GetInput'
d:\insight\insight\code\common\itkfiltermeshtomesh.txx(87) =
: error=20
C2995:
'PrintSelf' : template function has already been=20
defined
=20
d:\insight\insight\code\common\itkfiltermeshtomesh.h(82) : =
see
declaration of=20
'PrintSelf'
The code in itkFilterMeshToMesh.h (use SetInput as=20
example):
typedef TInputMesh InputMeshType;
typedef =
typename=20
InputMeshType::Pointer InputMeshPointer;
=
/**
* Set=20
the mesh input of this process object.
*/
void =
SetInput(InputMeshType *input);
itkFilterMeshToMesh.txx =
:
template=20
<class TInputMesh, class=20
TOutputMesh>
void
FilterMeshToMesh<TInputMesh,TOutputMesh>=
::SetInput(TInputMesh=20
*input)
{
this->ProcessObject::SetNthInput(0,=20
input);
}
It seems the complier think InputMeshType and =
TInputMesh are=20
different.
So how to solve the problem?
Another question is: =
did any=20
anybody try to include vnl_matrix object in
their class? I always got =
error=20
messages when I tried to do so.