<!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 & 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 "Configure Properties -> C/C++ -> General -> Additional<BR>
Include Directories" 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->General->Additional Library Directories the<BR>
Directory:<BR>
<BR>
$(ITK_BINARY)\bin\debug<BR>
<BR>
8. Added under Linker->Input->Additional Dependencies the following libs:<BR>
<BR>
ITKIO.lib<BR>
ITKNrrdIO.lib<BR>
itkgdcm.lib<BR>
itkjpeg12.lib<BR>
itkjpeg16.lib<BR>
itkopenjpeg.lib<BR>
itkpng.lib<BR>
itktiff.lib<BR>
itkjpeg8.lib<BR>
ITKSpatialObject.lib<BR>
ITKCommon.lib<BR>
itkvnl_inst.lib<BR>
itkvnl_algo.lib<BR>
itkv3p_netlib.lib<BR>
itkvnl.lib<BR>
itkvcl.lib<BR>
ITKMetaIO.lib<BR>
itksys.lib<BR>
ITKDICOMParser.lib<BR>
ITKEXPAT.lib<BR>
ITKniftiio.lib<BR>
ITKznz.lib<BR>
itkzlib.lib<BR>
kernel32.lib<BR>
user32.lib<BR>
gdi32.lib<BR>
winspool.lib<BR>
shell32.lib<BR>
ole32.lib<BR>
oleaut32.lib<BR>
uuid.lib<BR>
comdlg32.lib<BR>
advapi32.lib<BR>
snmpapi.lib<BR>
comctl32.lib<BR>
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>
typedef itk::Image< unsigned short, 3 > ImageType; <BR>
ImageType::Pointer image = ImageType::New();<BR>
<BR>
and included "itkImage.h" .<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 "public:<BR>
virtual void __thiscall itk::HRGN::Print(class<BR>
std::basic_ostream<char,struct std::char_traits<char> > &,class<BR>
itk::Indent)const "<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>
"protected: virtual void __thiscall itk::HRGN::PrintHeader(class<BR>
std::basic_ostream<char,struct std::char_traits<char> > &,class<BR>
itk::Indent)const "<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>
"protected: virtual void __thiscall itk::HRGN::PrintTrailer(class<BR>
std::basic_ostream<char,struct std::char_traits<char> > &,class<BR>
itk::Indent)const "<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>
"protected: virtual void __thiscall itk::HRGN::PrintSelf(class<BR>
std::basic_ostream<char,struct std::char_traits<char> > &,class<BR>
itk::Indent)const "<BR>
(?PrintSelf@HRGN@itk@@MBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@VIndent@2@@Z)<BR>
ImportManager.obj : error LNK2001: unresolved external symbol "public:<BR>
static double const itk::NumericTraits<double>::Zero"<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>