[Insight-users] errors instantiating custom itk classes

Dean Inglis dean.inglis at camris.ca
Thu Oct 27 17:47:30 EDT 2011


I am developing a custom transform initializer class to circumvent setting 
up the
parameters for a pointset to image registration pipeline.  I modified
CenteredTransformInitializer to take a pointset instead of a fixed image
and then a CenteredVersorTransformInitializer as well.  I am getting the
following errors when instantiating the class in (on Ubuntu, Unix Makefiles 
CMake generator)

CMakeFiles/PointSetTest5.dir/PointSetTest5.cxx.o: In function 
`itk::CustomVersorTransformInitializer<itk::PointSet<unsigned char, 3u, 
itk::DefaultStaticMeshTraits<unsigned char, 3u, 3u, float, float, unsigned 
char> >, itk::Image<unsigned char, 3u> >::New()':
/home/dean/files/repository/test/itkCustomVersorTransformInitializer.h:57: 
undefined reference to 
`itk::CustomVersorTransformInitializer<itk::PointSet<unsigned char, 3u, 
itk::DefaultStaticMeshTraits<unsigned char, 3u, 3u, float, float, unsigned 
char> >, itk::Image<unsigned char, 3u> 
 >::CustomVersorTransformInitializer()'
collect2: ld returned 1 exit status
make[2]: *** [PointSetTest5] Error 1
make[1]: *** [CMakeFiles/PointSetTest5.dir/all] Error 2
make: *** [all] Error 2

on Windows 7 with nmake in visual studio 2010 i get:

Linking CXX executable PointSetTest5.exe
   Creating library PointSetTest5.lib and object PointSetTest5.exp
PointSetTest5.cxx.obj : error LNK2019: unresolved external symbol 
"protected: __
thiscall itk::CustomVersorTransformInitializer<class itk::PointSet<unsigned 
char
,3,class itk::DefaultStaticMeshTraits<unsigned char,3,3,float,float,unsigned 
cha
r> >,class itk::Image<unsigned char,3> 
 >::CustomVersorTransformInitializer<class
 itk::PointSet<unsigned char,3,class itk::DefaultStaticMeshTraits<unsigned 
char,
3,3,float,float,unsigned char> >,class itk::Image<unsigned char,3> >(void)" 
(??0
?$CustomVersorTransformInitializer at V?$PointSet at E$02V?$DefaultStaticMeshTraits at E$
02$02MME at itk@@@itk@@V?$Image at E$02 at 2@@itk@@IAE at XZ) referenced in function 
"public
: static class itk::SmartPointer<class 
itk::CustomVersorTransformInitializer<cla
ss itk::PointSet<unsigned char,3,class itk::DefaultStaticMeshTraits<unsigned 
cha
r,3,3,float,float,unsigned char> >,class itk::Image<unsigned char,3> > > 
__cdecl
 itk::CustomVersorTransformInitializer<class itk::PointSet<unsigned 
char,3,class
 itk::DefaultStaticMeshTraits<unsigned char,3,3,float,float,unsigned char> 
 >,cla
ss itk::Image<unsigned char,3> >::New(void)" 
(?New@?$CustomVersorTransformInitia
lizer at V?$PointSet at E$02V?$DefaultStaticMeshTraits at E$02$02MME at itk@@@itk@@V?$Image@
E$02 at 2@@itk@@SA?AV?$SmartPointer at V?$CustomVersorTransformInitializer at V?$PointSet
@E$02V?$DefaultStaticMeshTraits at E$02$02MME at itk@@@itk@@V?$Image at E$02 at 2@@itk@@@2 at X
Z)
PointSetTest5.exe : fatal error LNK1120: 1 unresolved externals
LINK Pass 1 failed. with 2
NMAKE : fatal error U1077: '"C:\Program Files (x86)\CMake 
2.8\bin\cmake.exe"' :
return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 
10.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 
10.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.

attached are the source files for the customized classes.  Any help would be 
greatly appreciated..
thanks,
Dean
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: itkCustomTransformInitializer.h
URL: <http://www.itk.org/pipermail/insight-users/attachments/20111027/a67d71db/attachment.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: itkCustomTransformInitializer.hxx
URL: <http://www.itk.org/pipermail/insight-users/attachments/20111027/a67d71db/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: itkCustomVersorTransformInitializer.h
URL: <http://www.itk.org/pipermail/insight-users/attachments/20111027/a67d71db/attachment-0001.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: itkCustomVersorTransformInitializer.hxx
URL: <http://www.itk.org/pipermail/insight-users/attachments/20111027/a67d71db/attachment-0001.txt>


More information about the Insight-users mailing list