[Insight-users] Can I use ITK as a encapsulation function isolated outside of ITK?

Goo gtshowtime at gmail.com
Sun Aug 27 07:18:45 EDT 2006


Hi,everyone:

Can I use ITK code as a encapsulation function or class?
After encapsulation function, it maybe only  easily  to  use ITK function as

general call  function.

What should I do?

Note :
I refer to InsightApplication/ITKFilterLib/ and build this project.
It can generate a .lib file.
But when I test this lib separately,
the code
itkFilterLib filter(inputDimSize, inputOrigin, inputSpacing);
has a link error as below:
How should I solve this problem?

=====================================================
--------------------Configuration: ITKFilterLibTest - Win32
Debug--------------------
Linking...
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall
std::ios_base::Init::Init(void)" (??0Init at ios_base@std@@QAE at XZ) already
defined in libcpd.lib(iostream.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall
std::ios_base::Init::~Init(void)" (??1Init@ ios_base at std@@QAE at XZ) already
defined in libcpd.lib(iostream.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall
std::_Winit::_Winit(void)" (??0_Winit at std@@QAE at XZ) already defined in
libcpd.lib (wiostrea.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall
std::_Winit::~_Winit(void)" (??1_Winit at std@@QAE at XZ) already defined in
libcpd.lib(wiostrea.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::~basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_strin

g at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QAE at XZ) already defined in
ITKFilterLibTest.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: char const * __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@
DU?$char_traits at D@std@@V?$allocator at D@2@@std@@Q
BEPBDXZ) already defined in ITKFilterLibTest.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "class
std::basic_ostream<char,struct std::char_traits<char> > & __cdecl
std::operator<<(class std::basic_ostream<char,struct std::char_traits<char>
> &,char const *)" (??6std@@ YAAAV?$basic_ostream at DU?$cha
r_traits at D@std@@@0 at AAV10@PBD at Z) already defined in ITKFilterLibTest.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: virtual __thiscall
std::basic_ios<char,struct std::char_traits<char> >::~basic_ios<char,struct
std::char_traits<char> >(void)" (??1?$basic_ios@ DU?$char_traits at D
@std@@@std@@UAE at XZ) already defined
in libcpd.lib(iostream.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "protected: __thiscall
std::basic_ios<char,struct std::char_traits<char> >::basic_ios<char,struct
std::char_traits<char> >(void)" (??0?$basic_ios@ DU?$char_traits at D
@std@@@std@@IAE at XZ) already defined in lib
cpd.lib(iostream.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class
std::basic_ostream<char,struct std::char_traits<char> > & __thiscall
std::basic_ostream<char,struct std::char_traits<char> >::operator<<(float)"
(??6?$basic_ostream@ DU?$char_traits at D@std@@@s
td@@QAEAAV01 at M@Z) already defined in ITKFilterLibTest.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class
std::basic_ostream<char,struct std::char_traits<char> > & __thiscall
std::basic_ostream<char,struct std::char_traits<char> >::operator<<(class
std::basic_ostream<char,struct std::char_traits
<char> > & (__cdecl*)(class std::basic_ostream<char,struct
std::char_traits<char> > &))" (??6?$basic_ostream at DU?$char_traits at D
@std@@@std@@QAEAAV01 at P6AAAV01@AAV01@@Z at Z) already defined in
ITKFilterLibTest.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "class
std::basic_ostream<char,struct std::char_traits<char> > & __cdecl
std::endl(class std::basic_ostream<char,struct std::char_traits<char> > &)"
(?endl at std@@ YAAAV?$basic_ostream at DU?$char_traits at D@std@@
@1 at AAV21@@Z) already defined in ITKFilterLibTest.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > & __thiscall std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >::operator=(ch
ar const *)" (??4?$basic_string at DU?$char_traits at D@std@@V?$allocator at D
@2@@std@@QAEAAV01 at PBD@Z) already defined in libcpd.lib(locale0.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(class
std::allocator<char
> const &)" (??0?$basic_string at DU?$char_traits at D@std@@V?$allocator at D
@2@@std@@QAE at ABV?$allocator at D@1@@Z) already defined in ITKFilterLibTest.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > & __thiscall std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >::operator=(cl
ass std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)" (??4?$basic_string at DU?$char_traits at D@std@@
V?$allocator at D@2@@std@@QAEAAV01 at ABV01@@Z) already defined in
ITKFilterLibTest.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > & __thiscall std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >::operator+=(c
lass std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)" (??Y?$basic_string at DU?$char_traits at D@std@@
V?$allocator at D@2@@std@@QAEAAV01 at ABV01@@Z) already defined in libcpd.lib(
locale.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(char const *,class
std::a
llocator<char> const &)" (??0?$basic_string at DU?$char_traits at D@std@@
V?$allocator at D@2@@std@@QAE at PBDABV?$allocator at D@1@@Z) already defined in
ITKFilterLibTest.obj
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: "public: virtual __thiscall
exception::~exception(void)" (??1exception@@ UAE at XZ) already defined in
LIBCD.lib(stdexcpt.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: "public: __thiscall
exception::exception(void)" (??0exception@@QAE at XZ) already defined in
LIBCD.lib(stdexcpt.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: "public: int __thiscall
type_info::operator==(class type_info const &)const "
(??8type_info@@QBEHABV0@@Z) already defined in LIBCD.lib(typinfo.obj)
LINK : warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other
libs; use /NODEFAULTLIB:library
Example_ITKFilterLib.lib(ITKFilterLib.obj) : error LNK2001: unresolved
external symbol "public: static void __cdecl itk::LightObject::operator
delete(void *)" (??3LightObject at itk@@SAXPAX at Z)
Example_ITKFilterLib.lib( ITKFilterLib.obj) : error LNK2001: unresolved
external symbol "public: static void * __cdecl itk::LightObject::operator
new(unsigned int)" (??2LightObject at itk@@SAPAXI at Z)
Example_ITKFilterLib.lib(ITKFilterLib.obj ) : error LNK2001: unresolved
external symbol "protected: virtual void __thiscall
itk::ProcessObject::RestoreInputReleaseDataFlags(void)"
(?RestoreInputReleaseDataFlags at ProcessObject@itk@@MAEXXZ)
Example_ITKFilterLib.lib( ITKFilterLib.obj) : error LNK2001: unresolved
external symbol "protected: virtual void __thiscall
itk::ProcessObject::CacheInputReleaseDataFlags(void)"
(?CacheInputReleaseDataFlags at ProcessObject@itk@@MAEXXZ)
Example_ITKFilterLib.lib(ITKFilterLib.obj) : error LNK2001: unresolved
external symbol "protected: virtual void __thiscall
itk::ProcessObject::PropagateResetPipeline(void)" (?PropagateResetPipeline@
ProcessObject at itk @@MAEXXZ)
Example_ITKFilterLib.lib(ITKFilterLib.obj) : error LNK2001: unresolved
external symbol "protected: virtual void __thiscall
itk::ProcessObject::GenerateOutputInformation(void)"
(?GenerateOutputInformation@ ProcessObject at itk@@MAEXXZ)
Example_ITKFilterLib.lib(ITKFilterLib.obj) : error LNK2001: unresolved
external symbol "protected: virtual void __thiscall
itk::ProcessObject::GenerateOutputRequestedRegion(class itk::DataObject *)"
(?GenerateOutputRequestedRegion@ ProcessObject at itk@
@MAEXPAVDataObject at 2@@Z)
.
.
.
.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060827/a4905e1d/attachment.html


More information about the Insight-users mailing list