<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.34">
<TITLE>RE: [Insight-users] Problem: Integrating ITK in an existing Project(VS 2005, C++) (error LNK2001)</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Hi,<BR>
<BR>
This seems similar to a problem of a colleague of mine. She had to include std.h (or something as generic as this, I can't recall for 100% sure).<BR>
<BR>
best,<BR>
Jeroen<BR>
<BR>
-----Original Message-----<BR>
From: insight-users-bounces+j.s.wijnhout=lumc.nl@itk.org on behalf of Fieselmann, Andreas (ext)<BR>
Sent: Wed 11/28/2007 10:06 AM<BR>
To: Chris Duwenkamp; insight-users@itk.org<BR>
Subject: AW: [Insight-users] Problem: Integrating ITK in an existing Project(VS 2005, C++) (error LNK2001)<BR>
<BR>
Hi Chris,<BR>
<BR>
I had the same problem and got these linker error.<BR>
Unfortunately, I can't help on this. But you can consider to put all ITK code in a dll (use CMake to configure this dll).<BR>
Then you can access your ITK code from you project by calling functions from the dll.<BR>
Contact me if you need further assistance!<BR>
<BR>
Regards,<BR>
<BR>
Andreas<BR>
<BR>
<BR>
-----Ursprüngliche Nachricht-----<BR>
Von: insight-users-bounces+andreas.fieselmann.ext=siemens.com@itk.org [<A HREF="mailto:insight-users-bounces+andreas.fieselmann.ext=siemens.com@itk.org">mailto:insight-users-bounces+andreas.fieselmann.ext=siemens.com@itk.org</A>] Im Auftrag von Chris Duwenkamp<BR>
Gesendet: Dienstag, 27. November 2007 14:02<BR>
An: insight-users@itk.org<BR>
Betreff: [Insight-users] Problem: Integrating ITK in an existing Project (VS 2005, C++) (error LNK2001)<BR>
<BR>
Hello,<BR>
<BR>
I am trying to integrate ITK in an existing C++-project.<BR>
<BR>
Therefor I have done the following steps:<BR>
<BR>
1. downloading &amp; decompress ITK 3.4.0<BR>
2. download C-Make 2.4<BR>
3. Build ITK with C-Make like described in the user guide<BR>
<BR>
until this step everything went fine, ITK build properly and the build<BR>
examples could be executet.<BR>
<BR>
But now i have to integrate the ITK librarys in my existing project and<BR>
thats where my problem is.<BR>
Normaly as described in the user guide you should use C-Make to create<BR>
the project file, but hence my project is still existing I tried to set<BR>
the neccessary project settings manully.<BR>
<BR>
Therefor I have done the the following:<BR>
<BR>
5. defined the systemvariables %ITK% and %ITK_BINARY% with the path to<BR>
the ITK-source code and the directory i have build ITK in. (in my case<BR>
%ITK% = C:\prog\dev\InsightToolkit-3.4.0 , %ITK_BINARY% =<BR>
C:\prog\dev\itk_binary )<BR>
<BR>
6. Added to &quot;Configure Properties -&gt; C/C++ -&gt; General -&gt; Additional<BR>
Include Directories&quot; the following directories:<BR>
<BR>
$(ITK_BINARY);<BR>
$(ITK)\Code\Algorithms;<BR>
$(ITK)\Code\BasicFilters;<BR>
$(ITK)\Code\Common;<BR>
$(ITK)\Code\Numerics;<BR>
$(ITK)\Code\IO;<BR>
$(ITK)\Code\Numerics\FEM;<BR>
$(ITK)\Code\Numerics\Statistics;<BR>
$(ITK)\Code\Numerics\NeuralNetworks;<BR>
$(ITK)\Code\SpatialObject;<BR>
$(ITK)\Utilities\MetaIO;<BR>
$(ITK)\Utilities\NrrdIO;<BR>
$(ITK)\Utilities\DICOMParser;<BR>
$(ITK_BINARY)\Utilities\DICOMParser;<BR>
$(ITK_BINARY)\Utilities\expat;<BR>
$(ITK)\Utilities\expat;<BR>
$(ITK)\Utilities\nifti\niftilib;<BR>
$(ITK)\Utilities\nifti\znzlib;<BR>
$(ITK)\Utilities\itkExtHdrs;<BR>
$(ITK_BINARY)\Utilities;<BR>
$(ITK)\Utilities;<BR>
$(ITK_BINARY)\Code\Common;<BR>
$(ITK)\Utilities\vxl\vcl;<BR>
$(ITK)\Utilities\vxl\core;<BR>
$(ITK_BINARY)\Utilities\vxl\vcl;<BR>
$(ITK_BINARY)\Utilities\vxl\core;<BR>
$(ITK_BINARY)\Utilities\gdcm;<BR>
$(ITK)\Utilities\gdcm\src;<BR>
$(ITK)\Utilities\vxl\v3p\netlib;<BR>
<BR>
7. Added under Linker-&gt;General-&gt;Additional Library Directories the<BR>
Directory:<BR>
<BR>
$(ITK_BINARY)\bin\debug<BR>
<BR>
8. Added under Linker-&gt;Input-&gt;Additional Dependencies&nbsp; the following libs:<BR>
<BR>
ITKIO.lib<BR>
&nbsp;ITKNrrdIO.lib<BR>
&nbsp;itkgdcm.lib<BR>
&nbsp;itkjpeg12.lib<BR>
&nbsp;itkjpeg16.lib<BR>
&nbsp;itkopenjpeg.lib<BR>
&nbsp;itkpng.lib<BR>
&nbsp;itktiff.lib<BR>
&nbsp;itkjpeg8.lib<BR>
&nbsp;ITKSpatialObject.lib<BR>
&nbsp;ITKCommon.lib<BR>
&nbsp;itkvnl_inst.lib<BR>
&nbsp;itkvnl_algo.lib<BR>
&nbsp;itkv3p_netlib.lib<BR>
&nbsp;itkvnl.lib<BR>
&nbsp;itkvcl.lib<BR>
&nbsp;ITKMetaIO.lib<BR>
&nbsp;itksys.lib<BR>
&nbsp;ITKDICOMParser.lib<BR>
&nbsp;ITKEXPAT.lib<BR>
&nbsp;ITKniftiio.lib<BR>
&nbsp;ITKznz.lib<BR>
&nbsp;itkzlib.lib<BR>
kernel32.lib<BR>
&nbsp;user32.lib<BR>
&nbsp;gdi32.lib<BR>
&nbsp;winspool.lib<BR>
&nbsp;shell32.lib<BR>
&nbsp;ole32.lib<BR>
&nbsp;oleaut32.lib<BR>
&nbsp;uuid.lib<BR>
&nbsp;comdlg32.lib<BR>
&nbsp;advapi32.lib<BR>
&nbsp;snmpapi.lib<BR>
&nbsp;comctl32.lib<BR>
&nbsp;wsock32.lib<BR>
<BR>
9. There i thought I have configured everything and wanted to try it<BR>
out, therefore i pasted the following code in one of my classes:<BR>
<BR>
&nbsp;&nbsp;&nbsp; typedef itk::Image&lt; unsigned short, 3 &gt; ImageType;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>
&nbsp;&nbsp;&nbsp; ImageType::Pointer image = ImageType::New();<BR>
<BR>
and included&nbsp; &quot;itkImage.h&quot; .<BR>
<BR>
10. The compiling went well and no errors showed but when I tryed to<BR>
build the project i got the following link-error :<BR>
<BR>
ImportManager.obj : error LNK2001: unresolved external symbol &quot;public:<BR>
virtual void __thiscall itk::HRGN::Print(class<BR>
std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;,class<BR>
itk::Indent)const &quot;<BR>
(?Print@HRGN@itk@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@VIndent@2@@Z)<BR>
ImportManager.obj : error LNK2001: unresolved external symbol<BR>
&quot;protected: virtual void __thiscall itk::HRGN::PrintHeader(class<BR>
std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;,class<BR>
itk::Indent)const &quot;<BR>
(?PrintHeader@HRGN@itk@@MBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@VIndent@2@@Z)<BR>
ImportManager.obj : error LNK2001: unresolved external symbol<BR>
&quot;protected: virtual void __thiscall itk::HRGN::PrintTrailer(class<BR>
std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;,class<BR>
itk::Indent)const &quot;<BR>
(?PrintTrailer@HRGN@itk@@MBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@VIndent@2@@Z)<BR>
ImportManager.obj : error LNK2001: unresolved external symbol<BR>
&quot;protected: virtual void __thiscall itk::HRGN::PrintSelf(class<BR>
std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;,class<BR>
itk::Indent)const &quot;<BR>
(?PrintSelf@HRGN@itk@@MBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@VIndent@2@@Z)<BR>
ImportManager.obj : error LNK2001: unresolved external symbol &quot;public:<BR>
static double const itk::NumericTraits&lt;double&gt;::Zero&quot;<BR>
(?Zero@?$NumericTraits@N@itk@@2NB)<BR>
<BR>
Did I forget to include something ?<BR>
<BR>
Thanks a lot for yiur help,<BR>
<BR>
Chris<BR>
<BR>
(PS: excuse my bad spelling, but english is not my nativ language)<BR>
_______________________________________________<BR>
Insight-users mailing list<BR>
Insight-users@itk.org<BR>
<A HREF="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</A><BR>
_______________________________________________<BR>
Insight-users mailing list<BR>
Insight-users@itk.org<BR>
<A HREF="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</A><BR>
<BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>