Hi,everyone:<br><br>Can I use ITK code as a encapsulation function or class?<br>After encapsulation function, it maybe only&nbsp; easily&nbsp; to&nbsp; use ITK function as <br>general call&nbsp; function.<br><br>What should I do?<br><br>Note : 
<br>I refer to InsightApplication/ITKFilterLib<div>/ and build this project.<br>It can generate a .lib file.<br>But when I test this lib separately,<br>the code<br>itkFilterLib filter(inputDimSize, inputOrigin, inputSpacing);
<br>
has a link error as below:<br>How should I solve this problem?<br><br>=====================================================<br>--------------------Configuration: ITKFilterLibTest - Win32 Debug--------------------<br>Linking...
<br>msvcprtd.lib(MSVCP60D.dll) : error LNK2005: &quot;public: __thiscall std::ios_base::Init::Init(void)&quot; (??0Init@ios_base@std@@QAE@XZ) already defined in libcpd.lib(iostream.obj)<br>msvcprtd.lib(MSVCP60D.dll) : error LNK2005: &quot;public: __thiscall std::ios_base::Init::~Init(void)&quot; (??1Init@
ios_base@std@@QAE@XZ) already defined in libcpd.lib(iostream.obj)<br>msvcprtd.lib(MSVCP60D.dll)
: error LNK2005: &quot;public: __thiscall std::_Winit::_Winit(void)&quot;
(??0_Winit@std@@QAE@XZ) already defined in libcpd.lib
(wiostrea.obj)<br>msvcprtd.lib(MSVCP60D.dll) : error LNK2005: &quot;public:
__thiscall std::_Winit::~_Winit(void)&quot; (??1_Winit@std@@QAE@XZ) already
defined in libcpd.lib(wiostrea.obj)<br>msvcprtd.lib(MSVCP60D.dll) :
error LNK2005: &quot;public: __thiscall std::basic_string&lt;char,struct
std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt;
&gt;::~basic_string&lt;char,struct std::char_traits&lt;char&gt;,class
std::allocator&lt;char&gt; &gt;(void)&quot; (??1?$basic_strin
<br>g@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in ITKFilterLibTest.obj<br>msvcprtd.lib(MSVCP60D.dll)
: error LNK2005: &quot;public: char const * __thiscall
std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class
std::allocator&lt;char&gt; &gt;::c_str(void)const &quot;
(?c_str@?$basic_string@
DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Q<br>BEPBDXZ) already defined in ITKFilterLibTest.obj<br>msvcprtd.lib(MSVCP60D.dll)
: error LNK2005: &quot;class std::basic_ostream&lt;char,struct
std::char_traits&lt;char&gt; &gt; &amp; __cdecl
std::operator&lt;&lt;(class std::basic_ostream&lt;char,struct
std::char_traits&lt;char&gt; &gt; &amp;,char const *)&quot; (??6std@@
YAAAV?$basic_ostream@DU?$cha<br>r_traits@D@std@@@0@AAV10@PBD@Z) already defined in ITKFilterLibTest.obj<br>msvcprtd.lib(MSVCP60D.dll)
: error LNK2005: &quot;public: virtual __thiscall
std::basic_ios&lt;char,struct std::char_traits&lt;char&gt;
&gt;::~basic_ios&lt;char,struct std::char_traits&lt;char&gt;
&gt;(void)&quot; (??1?$basic_ios@
DU?$char_traits@D@std@@@std@@UAE@XZ) already defined <br>in libcpd.lib(iostream.obj)<br>msvcprtd.lib(MSVCP60D.dll)
: error LNK2005: &quot;protected: __thiscall std::basic_ios&lt;char,struct
std::char_traits&lt;char&gt; &gt;::basic_ios&lt;char,struct
std::char_traits&lt;char&gt; &gt;(void)&quot; (??0?$basic_ios@
DU?$char_traits@D@std@@@std@@IAE@XZ) already defined in lib<br>cpd.lib(iostream.obj)<br>msvcprtd.lib(MSVCP60D.dll)
: error LNK2005: &quot;public: class std::basic_ostream&lt;char,struct
std::char_traits&lt;char&gt; &gt; &amp; __thiscall
std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt;
&gt;::operator&lt;&lt;(float)&quot; (??6?$basic_ostream@
DU?$char_traits@D@std@@@s<br>td@@QAEAAV01@M@Z) already defined in ITKFilterLibTest.obj<br>msvcprtd.lib(MSVCP60D.dll)
: error LNK2005: &quot;public: class std::basic_ostream&lt;char,struct
std::char_traits&lt;char&gt; &gt; &amp; __thiscall
std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt;
&gt;::operator&lt;&lt;(class std::basic_ostream&lt;char,struct
std::char_traits
<br>&lt;char&gt; &gt; &amp; (__cdecl*)(class
std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt;
&amp;))&quot;
(??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z)
already defined in ITKFilterLibTest.obj<br>msvcprtd.lib(MSVCP60D.dll) : error LNK2005:
&quot;class std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt;
&gt; &amp; __cdecl std::endl(class std::basic_ostream&lt;char,struct
std::char_traits&lt;char&gt; &gt; &amp;)&quot; (?endl@std@@
YAAAV?$basic_ostream@DU?$char_traits@D@std@@<br>@1@AAV21@@Z) already defined in ITKFilterLibTest.obj<br>msvcprtd.lib(MSVCP60D.dll)
: error LNK2005: &quot;public: class std::basic_string&lt;char,struct
std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt;
&amp; __thiscall std::basic_string&lt;char,struct
std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt;
&gt;::operator=(ch
<br>ar const *)&quot;
(??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z)
already defined in libcpd.lib(locale0.obj)<br>msvcprtd.lib(MSVCP60D.dll)
: error LNK2005: &quot;public: __thiscall std::basic_string&lt;char,struct
std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt;
&gt;::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class
std::allocator&lt;char&gt; &gt;(class std::allocator&lt;char
<br>&gt; const &amp;)&quot;
(??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$allocator@D@1@@Z)
already defined in ITKFilterLibTest.obj<br>msvcprtd.lib(MSVCP60D.dll) :
error LNK2005: &quot;public: class std::basic_string&lt;char,struct
std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt;
&amp; __thiscall std::basic_string&lt;char,struct
std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt;
&gt;::operator=(cl
<br>ass std::basic_string&lt;char,struct
std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt;
const &amp;)&quot;
(??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z)
already defined in ITKFilterLibTest.obj<br>msvcprtd.lib(MSVCP60D.dll) : error LNK2005:
&quot;public: class std::basic_string&lt;char,struct
std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt;
&amp; __thiscall std::basic_string&lt;char,struct
std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt;
&gt;::operator+=(c
<br>lass std::basic_string&lt;char,struct
std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt;
const &amp;)&quot;
(??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) already defined in 
libcpd.lib(locale.obj)<br>msvcprtd.lib(MSVCP60D.dll)
: error LNK2005: &quot;public: __thiscall std::basic_string&lt;char,struct
std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt;
&gt;::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class
std::allocator&lt;char&gt; &gt;(char const *,class std::a
<br>llocator&lt;char&gt; const &amp;)&quot;
(??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDABV?$allocator@D@1@@Z)
already defined in ITKFilterLibTest.obj<br>MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: &quot;public: virtual __thiscall exception::~exception(void)&quot; (??1exception@@
UAE@XZ) already defined in LIBCD.lib(stdexcpt.obj)<br>MSVCRTD.lib(MSVCRTD.dll)
: error LNK2005: &quot;public: __thiscall exception::exception(void)&quot;
(??0exception@@QAE@XZ) already defined in LIBCD.lib(stdexcpt.obj)<br>
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: &quot;public: int __thiscall
type_info::operator==(class type_info const &amp;)const &quot;
(??8type_info@@QBEHABV0@@Z) already defined in LIBCD.lib(typinfo.obj)<br>LINK : warning LNK4098: defaultlib &quot;MSVCRTD&quot; conflicts with use of other libs; use /NODEFAULTLIB:library
<br>Example_ITKFilterLib.lib(ITKFilterLib.obj) : error LNK2001:
unresolved external symbol &quot;public: static void __cdecl
itk::LightObject::operator delete(void *)&quot;
(??3LightObject@itk@@SAXPAX@Z)<br>Example_ITKFilterLib.lib(
ITKFilterLib.obj) : error LNK2001: unresolved external symbol &quot;public:
static void * __cdecl itk::LightObject::operator new(unsigned int)&quot;
(??2LightObject@itk@@SAPAXI@Z)<br>Example_ITKFilterLib.lib(ITKFilterLib.obj
) : error LNK2001: unresolved external symbol &quot;protected: virtual void __thiscall itk::ProcessObject::RestoreInputReleaseDataFlags(void)&quot; (?RestoreInputReleaseDataFlags@ProcessObject@itk@@MAEXXZ)<br>Example_ITKFilterLib.lib(
ITKFilterLib.obj) : error LNK2001: unresolved external symbol
&quot;protected: virtual void __thiscall itk::ProcessObject::CacheInputReleaseDataFlags(void)&quot; (?CacheInputReleaseDataFlags@ProcessObject@itk@@MAEXXZ)<br>
Example_ITKFilterLib.lib(ITKFilterLib.obj) : error LNK2001: unresolved
external symbol &quot;protected: virtual void __thiscall
itk::ProcessObject::PropagateResetPipeline(void)&quot; (?PropagateResetPipeline@ProcessObject@itk
@@MAEXXZ)<br>Example_ITKFilterLib.lib(ITKFilterLib.obj)
: error LNK2001: unresolved external symbol &quot;protected: virtual void
__thiscall itk::ProcessObject::GenerateOutputInformation(void)&quot; (?GenerateOutputInformation@
ProcessObject@itk@@MAEXXZ)<br>Example_ITKFilterLib.lib(ITKFilterLib.obj)
: error LNK2001: unresolved external symbol &quot;protected: virtual void
__thiscall itk::ProcessObject::GenerateOutputRequestedRegion(class itk::DataObject *)&quot; (?GenerateOutputRequestedRegion@
ProcessObject@itk@<br>@MAEXPAVDataObject@2@@Z)<br>.<br>.<br>.<br>.<br><br><br></div>