[Insight-users] linker erros with ITK 2.0.0

Rama Aravind Vorray ramavorray at yahoo.com
Sat Sep 10 19:02:51 EDT 2005


Hi Karthik,

I received these errors even though I did all that you
said. Here are they.

My project settings are set to use MFC as static
library and link settings are set to use
"Multi-Threaded Debug" for Debug build.

I included ITKCommon.lib like this,

#pragma comment(lib, "itkCommon.lib")

in the ChildView.cpp (main file for creating
application window)

I got include directories from ITKConfig.cmake file
and they are below, {$(ITKDIR) is set to E:\ITK-2.0.0
where I installed ITK}

$(ITKDIR)\Utilities\vxl\core;
$(ITKDIR)\Utilities\vxl\vcl;
$(ITKDIR)\InsightToolkit-2.0.0\Utilities\vxl\core;
$(ITKDIR)\InsightToolkit-2.0.0\Utilities\vxl\vcl;
$(ITKDIR)\InsightToolkit-2.0.0\Utilities;
$(ITKDIR)\Utilities;
$(ITKDIR)\Utilities\gdcm;
$(ITKDIR)\InsightToolkit-2.0.0\Utilities\expat;
$(ITKDIR)\Utilities\expat;
$(ITKDIR)\Utilities\DICOMParser;
$(ITKDIR)\InsightToolkit-2.0.0\Utilities\DICOMParser;
$(ITKDIR)\InsightToolkit-2.0.0\Utilities\NrrdIO;
$(ITKDIR)\InsightToolkit-2.0.0\Utilities\MetaIO;
$(ITKDIR)\InsightToolkit-2.0.0\Code\SpatialObject;
$(ITKDIR)\InsightToolkit-2.0.0\Code\Numerics\Statistics;
$(ITKDIR)\InsightToolkit-2.0.0\Code\Numerics\FEM;
$(ITKDIR)\InsightToolkit-2.0.0\Code\IO;
$(ITKDIR)\InsightToolkit-2.0.0\Code\Numerics;
$(ITKDIR)\InsightToolkit-2.0.0\Code\Common;
$(ITKDIR)\InsightToolkit-2.0.0\Code\BasicFilters;
$(ITKDIR)\InsightToolkit-2.0.0\Code\Algorithms;
$(ITKDIR);

and the include directory for .LIB files is

$(ITKDIR)\bin\debug (for debug version of my code)

$(ITKDIR)\bin\debug is the place where all .lib files
are stored by ITK when I built Debug version of it.

I can't use CMake as I already had a MFC project and I
want to use ITK for just one task, that is Rotating a
3D image. So, I can't use CMake at this stage as I
already had a big MFC based project.

Above are the steps that I did and followed and here
is the only ITK code that I used with which I am
receiving these innumerable link errors.

const unsigned int Dimension=3;
typedef unsigned char InputPixelType;
typedef unsigned char OutputPixelType;
typedef itk::Image<InputPixelType, Dimension>
InputImage;
typedef itk::Image<OutputPixelType, Dimension>
OutputImage;
typedef itk::AffineTransform<double, Dimension>
TransformType;
TransformType::Pointer transform=TransformType::New();
transform=TransformType::Delete();

For eg., these errors are LNK2001 and LNK 2005. They
are about some hundred in number, so giving all of
them will be trivial here.

Can you please suggest me what else can I do to get
rid of these link errors.

thanks,
Aravind.


--- Karthik Krishnan <Karthik.Krishnan at kitware.com>
wrote:

> These errors are because you did not link against
> ITKCommon.lib
> 
> Actually there are a few more libraries you have to
> link against... 
> additional linker and C++ include directories,
> etc... and you need to 
> ensure that you don't mix libraries of different
> types (static vs 
> dynamic, MT vs Single threaded etc.. )
> 
> Is there a a reason you are not using CMake to
> generate the project ?.. 
> If you can't, generate an dummy project using CMake
> and copy the linker 
> and C++ settings.
> 
> HTH
> karthik
> 
> 
> Rama Aravind Vorray wrote:
> 
> >Hi,
> >
> >ITK version - 2.0.0
> >platform - winxp - MS Visual Studio .NET 2003
> >
> >This mail is in addition to my previous mail with
> >subject "compile time errors in MSVC.net using
> MFCs".
> >
> >To get rid of the errors that I said in that mail,
> I
> >included the #include itkAffineTransform.h and
> other
> >files before MFC includes in stdafx.h
> >
> >Then I get rid off the errors that I said in my
> >previous mail, but now I am faced with hundreds of
> >linker errors.
> >
> >Below are some of the linker errors that I am
> getting.
> >One form of errors are LNK 2001 and others are of
> >LNK2019
> >
> >I know that these normally come when incompatible
> >libraries are used. But I compiled ITK 2.0.0
> recently
> >and I included the .lib files (those folders) that
> ITK
> >had generated, in my project settings.
> >
> >Here are the errors. I am onlyu giving a few of
> them
> >as giving all of them will be a clutter and also it
> is
> >non-trivial.
> >
> >Can anyone please suggest me how to get rid of
> these
> >link errors.
> >
> >LNK2001: unresolved external symbol "public: static
> >double const itk::NumericTraits<double>::Zero"
> >(?Zero@?$NumericTraits at N@itk@@2NB)
> >
> >LNK2001: unresolved external symbol "protected:
> >virtual void __thiscall
> >itk::LightObject::PrintHeader(class
> >std::basic_ostream<char,struct
> std::char_traits<char>
> >  
> >
> >>&,class itk::Indent)const "
> >>    
> >>
>
>(?PrintHeader at LightObject@itk@@MBEXAAV?$basic_ostream at DU?$char_traits at D@std@@@std@@VIndent at 2@@Z)
> >
> >LNK2001: unresolved external symbol "protected:
> >virtual void __thiscall
> >itk::LightObject::PrintTrailer(class
> >std::basic_ostream<char,struct
> std::char_traits<char>
> >  
> >
> >>&,class itk::Indent)const "
> >>    
> >>
>
>(?PrintTrailer at LightObject@itk@@MBEXAAV?$basic_ostream at DU?$char_traits at D@std@@@std@@VIndent at 2@@Z)
> >
> >LNK2001: unresolved external symbol "protected:
> >virtual void __thiscall
> itk::Object::PrintSelf(class
> >std::basic_ostream<char,struct
> std::char_traits<char>
> >  
> >
> >>&,class itk::Indent)const "
> >>    
> >>
>
>(?PrintSelf at Object@itk@@MBEXAAV?$basic_ostream at DU?$char_traits at D@std@@@std@@VIndent at 2@@Z)
> >
> >LNK2001: unresolved external symbol "public:
> virtual
> >unsigned long __thiscall
> >itk::Object::GetMTime(void)const "
> >(?GetMTime at Object@itk@@UBEKXZ)
> >
> >LNK2019: unresolved external symbol "class
> >std::basic_ostream<char,struct
> std::char_traits<char>
> >  
> >
> >>& __cdecl itk::operator<<(class
> >>    
> >>
> >std::basic_ostream<char,struct
> std::char_traits<char>
> >  
> >
> >>&,class itk::Indent const &)"
> >>    
> >>
>
>(??6itk@@YAAAV?$basic_ostream at DU?$char_traits at D@std@@@std@@AAV12 at ABVIndent@0@@Z)
> >referenced in function "protected: virtual void
> >__thiscall
> >itk::AffineTransform<double,3>::PrintSelf(class
> >std::basic_ostream<char,struct
> std::char_traits<char>
> >  
> >
> >>&,class itk::Indent)const "
> >>    
> >>
>
>(?PrintSelf@?$AffineTransform at N$02 at itk@@MBEXAAV?$basic_ostream at DU?$char_traits at D@std@@@std@@VIndent at 2@@Z)
> >
> >LNK2019: unresolved external symbol "protected:
> >__thiscall itk::Object::Object(void)"
> >(??0Object at itk@@IAE at XZ) referenced in function
> >"protected: __thiscall
>
>itk::Transform<double,3,3>::Transform<double,3,3>(void)"
> >(??0?$Transform at N$02$02 at itk@@IAE at XZ)
> >
> >LNK2019: unresolved external symbol "protected:
> >virtual __thiscall itk::Object::~Object(void)"
> >(??1Object at itk@@MAE at XZ) referenced in function
> >"protected: virtual __thiscall
>
>itk::Transform<double,3,3>::~Transform<double,3,3>(void)"
> >(??1?$Transform at N$02$02 at itk@@MAE at XZ)
> >
> >LNK2019: unresolved external symbol "public:
> >__thiscall
> >vnl_matrix<double>::~vnl_matrix<double>(void)"
> >(??1?$vnl_matrix at N@@QAE at XZ) referenced in function
> >"public: __thiscall
> >itk::Array2D<double>::~Array2D<double>(void)"
> >(??1?$Array2D at N@itk@@QAE at XZ)
> >
> >thanks,
> >Aravind.
> >
> >
> >	
> >		
>
>______________________________________________________
> >Click here to donate to the Hurricane Katrina
> relief effort.
> >http://store.yahoo.com/redcross-donate3/
> >_______________________________________________
> >Insight-users mailing list
> >Insight-users at itk.org
> >http://www.itk.org/mailman/listinfo/insight-users
> >
> >  
> >
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 



	
		
______________________________________________________
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/


More information about the Insight-users mailing list