[vtkusers] [Insight-users] LNK2019 error when compiling project with ITK and VTK

Bill Lorensen bill.lorensen at gmail.com
Mon Apr 11 10:37:44 EDT 2011


ITKv4 has been reorganized as part of the ITK Modularization effort:
http://itk.org/Wiki/ITK_Release_4/Modularization

Prior to modularization, there were about 15 libraries including
ITKBasicFilters.

Now there are over 45 libraries. You can find them in the /lib directory of
your build tree.

If you use CMake, you the line
target_link_libraries(your_project ${ITK_LIBRARIES})

works for both the old and new organization.

On Mon, Apr 11, 2011 at 8:48 AM, Bc. Michal Srna <michal at srna.info> wrote:

> I think I already know, what you meant - you tought to add to "Additional
> Dependencies" under "Project Properties" directly the library
> "ITKBasicFilters.lib", but I can't locate this lib  in library folder
> "\lib\Debug" under the ITKv4 build.
>
> I tried to add this lib file from build of ITK 3.20, where is this file
> present (in bin\Debug) and now it works!
>
> But now I have to use build of ITKv4 (which I use normally) and also the
> build of ITKv3.20 (from which I use only the ITKBasicFilters.lib).
>
> Is there some way to get ITKBasicFilters.lib from build of ITKv4?
>
> Thanks.
>
> Michal
>
> 2011/4/11 Bc. Michal Srna <michal at srna.info>
>
>> Thanks for reply Luis,
>>
>> I have located the file "itkVTKImageExportBase.cxx" in
>>
>> InsightToolkit_SOURCE_DIR\
>> Modules\Bridge\VTK\src
>>
>> because I use ITKv4 from git.
>>
>> I don't know If I understood you right - I added that folder
>> (InsightToolkit_SOURCE_DIR\Modules\Bridge\VTK\src), which contains file
>> "itkVTKImageExportBase.cxx" into Additional Library Directories under my
>> project properties in MVSC++, but nothing happened.
>>
>> Am I doing something wrong?
>>
>> Thanks for help in advance!
>>
>>
>> 2011/4/11 Luis Ibanez <luis.ibanez at kitware.com>
>>
>>> Hi Michal,
>>>
>>>
>>> You are missing to link to the library
>>>
>>>                        ITKBasicFilters
>>>
>>>
>>> In general, whenever you get a link error about missing
>>> symbols, you could try greping for that symbol in the
>>> source tree of the toolkit (that's the beauty of open source).
>>>
>>> In this case, if you grep for the symbol with the command:
>>>
>>>               grep -lr GetCallbackUserData *
>>>
>>> you will get:
>>>
>>> Code/BasicFilters/itkVTKImageExportBase.h
>>> Code/BasicFilters/itkVTKImageExportBase.cxx
>>>
>>> Wrapping/WrapITK/ExternalProjects/ItkVtkGlue/src/itkVTKImageToImageFilter.txx
>>>
>>> Wrapping/WrapITK/ExternalProjects/ItkVtkGlue/src/itkImageToVTKImageFilter.txx
>>>
>>>
>>> you can discard the hits in the Wrapping directory
>>> (unless you are doing wrapping, of course).
>>>
>>>
>>> So you are left with a .cxx file in the directory
>>>
>>>             Code/BasicFilters
>>>
>>> If you then open the CMakeLists.txt file and search
>>> for "itkVTKImageExportBase.cxx" you will find it in
>>> the line:
>>>
>>> ADD_LIBRARY(ITKBasicFilters itkVTKImageExportBase.cxx)
>>>
>>> Which states the the itkVTKImageExportBase.cxx will be
>>> used to create the library "ITKBasicFilters".
>>>
>>>
>>> Therefore,...
>>> you can resolve the missing symbol by adding
>>>
>>>                    ITKBasicFilters
>>>
>>> to your list of libraries to link against.
>>>
>>>
>>> ---------------------------------------------------------------------
>>>
>>>
>>>   "Glimpsing at the Source
>>>     leavers no doubt"
>>>
>>>                           Ming Dao
>>>
>>>
>>> ----------------------------------------------------------------------
>>>
>>>
>>>     Luis
>>>
>>>
>>> ------------------------------------------------
>>> On Sun, Apr 10, 2011 at 1:08 PM, Bc. Michal Srna <michal at srna.info>
>>> wrote:
>>> > Hello VTK users,
>>> >
>>> > in my project I use ITKv4 and now I would like to use some features of
>>> VTK.
>>> > I downloaded the latest version vtk-5.6.1, used CMAKE, without errors
>>> build
>>> > VTK with MVSC++ 2008 and added path to all VTK libraries to project
>>> > properties. I also added all VTK *.lib files to Additional Dependencies
>>> > under project properties.
>>> >
>>> > Now I want only to connect output of ITK pipeline to VTK, the code is:
>>> >
>>> > typedef itk::ImageToVTKImageFilter<TransformedImageType> ConnectorType;
>>> > ConnectorType::Pointer connector= ConnectorType::New();
>>> >
>>> > connector->SetInput( TransformedImportFilter->GetOutput() );
>>> >
>>> > where TransformedImportFilter is ITK output of ImportImageFilter.
>>> >
>>> > I also included this headers:
>>> >
>>> > #include "itkImageToVTKImageFilter.h"
>>> >
>>> > When I want to compile my project, I get these errors:
>>> >
>>> > 1>visualization_routines.obj : error LNK2019: unresolved external
>>> symbol
>>> > "public: void * __thiscall
>>> > itk::VTKImageExportBase::GetCallbackUserData(void)"
>>> > (?GetCallbackUserData at VTKImageExportBase@itk@@QAEPAXXZ) referenced in
>>> > function "protected: __thiscall itk::ImageToVTKImageFilter<class
>>> > itk::Image<short,3> >::ImageToVTKImageFilter<class itk::Image<short,3>
>>> >>(void)" (??0?$ImageToVTKImageFilter at V?$Image at F$02 at itk@@@itk@@IAE at XZ)
>>> > 1>visualization_routines.obj : error LNK2019: unresolved external
>>> symbol
>>> > "public: void * (__cdecl*__thiscall
>>> > itk::VTKImageExportBase::GetBufferPointerCallback(void)const )(void *)"
>>> > (?GetBufferPointerCallback at VTKImageExportBase@itk@@QBEP6APAXPAX at ZXZ)
>>> > referenced in function "protected: __thiscall
>>> > itk::ImageToVTKImageFilter<class itk::Image<short,3>
>>> >>::ImageToVTKImageFilter<class itk::Image<short,3> >(void)"
>>> > (??0?$ImageToVTKImageFilter at V?$Image at F$02 at itk@@@itk@@IAE at XZ)
>>> > 1>visualization_routines.obj : error LNK2019: unresolved external
>>> symbol
>>> > "public: int * (__cdecl*__thiscall
>>> > itk::VTKImageExportBase::GetDataExtentCallback(void)const )(void *)"
>>> > (?GetDataExtentCallback at VTKImageExportBase@itk@@QBEP6APAHPAX at ZXZ)
>>> referenced
>>> > in function "protected: __thiscall itk::ImageToVTKImageFilter<class
>>> > itk::Image<short,3> >::ImageToVTKImageFilter<class itk::Image<short,3>
>>> >>(void)" (??0?$ImageToVTKImageFilter at V?$Image at F$02 at itk@@@itk@@IAE at XZ)
>>> > 1>visualization_routines.obj : error LNK2019: unresolved external
>>> symbol
>>> > "public: void (__cdecl*__thiscall
>>> > itk::VTKImageExportBase::GetUpdateDataCallback(void)const )(void *)"
>>> > (?GetUpdateDataCallback at VTKImageExportBase@itk@@QBEP6AXPAX at ZXZ)
>>> referenced
>>> > in function "protected: __thiscall itk::ImageToVTKImageFilter<class
>>> > itk::Image<short,3> >::ImageToVTKImageFilter<class itk::Image<short,3>
>>> >>(void)" (??0?$ImageToVTKImageFilter at V?$Image at F$02 at itk@@@itk@@IAE at XZ)
>>> > 1>visualization_routines.obj : error LNK2019: unresolved external
>>> symbol
>>> > "public: void (__cdecl*__thiscall
>>> > itk::VTKImageExportBase::GetPropagateUpdateExtentCallback(void)const
>>> )(void
>>> > *,int *)"
>>> > (?GetPropagateUpdateExtentCallback at VTKImageExportBase@itk@
>>> @QBEP6AXPAXPAH at ZXZ)
>>> > referenced in function "protected: __thiscall
>>> > itk::ImageToVTKImageFilter<class itk::Image<short,3>
>>> >>::ImageToVTKImageFilter<class itk::Image<short,3> >(void)"
>>> > (??0?$ImageToVTKImageFilter at V?$Image at F$02 at itk@@@itk@@IAE at XZ)
>>> > 1>visualization_routines.obj : error LNK2019: unresolved external
>>> symbol
>>> > "public: int (__cdecl*__thiscall
>>> > itk::VTKImageExportBase::GetNumberOfComponentsCallback(void)const
>>> )(void *)"
>>> > (?GetNumberOfComponentsCallback at VTKImageExportBase@itk@@QBEP6AHPAX at ZXZ
>>> )
>>> > referenced in function "protected: __thiscall
>>> > itk::ImageToVTKImageFilter<class itk::Image<short,3>
>>> >>::ImageToVTKImageFilter<class itk::Image<short,3> >(void)"
>>> > (??0?$ImageToVTKImageFilter at V?$Image at F$02 at itk@@@itk@@IAE at XZ)
>>> > 1>visualization_routines.obj : error LNK2019: unresolved external
>>> symbol
>>> > "public: char const * (__cdecl*__thiscall
>>> > itk::VTKImageExportBase::GetScalarTypeCallback(void)const )(void *)"
>>> > (?GetScalarTypeCallback at VTKImageExportBase@itk@@QBEP6APBDPAX at ZXZ)
>>> referenced
>>> > in function "protected: __thiscall itk::ImageToVTKImageFilter<class
>>> > itk::Image<short,3> >::ImageToVTKImageFilter<class itk::Image<short,3>
>>> >>(void)" (??0?$ImageToVTKImageFilter at V?$Image at F$02 at itk@@@itk@@IAE at XZ)
>>> > 1>visualization_routines.obj : error LNK2019: unresolved external
>>> symbol
>>> > "public: class itk::VTKImageExportBase::CallbackTypeProxy __thiscall
>>> > itk::VTKImageExportBase::GetOriginCallback(void)const "
>>> > (?GetOriginCallback at VTKImageExportBase@itk@@QBE?AVCallbackTypeProxy at 12
>>> @XZ)
>>> > referenced in function "protected: __thiscall
>>> > itk::ImageToVTKImageFilter<class itk::Image<short,3>
>>> >>::ImageToVTKImageFilter<class itk::Image<short,3> >(void)"
>>> > (??0?$ImageToVTKImageFilter at V?$Image at F$02 at itk@@@itk@@IAE at XZ)
>>> > 1>visualization_routines.obj : error LNK2019: unresolved external
>>> symbol
>>> > "public: class itk::VTKImageExportBase::CallbackTypeProxy __thiscall
>>> > itk::VTKImageExportBase::GetSpacingCallback(void)const "
>>> > (?GetSpacingCallback at VTKImageExportBase@itk@
>>> @QBE?AVCallbackTypeProxy at 12@XZ)
>>> > referenced in function "protected: __thiscall
>>> > itk::ImageToVTKImageFilter<class itk::Image<short,3>
>>> >>::ImageToVTKImageFilter<class itk::Image<short,3> >(void)"
>>> > (??0?$ImageToVTKImageFilter at V?$Image at F$02 at itk@@@itk@@IAE at XZ)
>>> > 1>visualization_routines.obj : error LNK2019: unresolved external
>>> symbol
>>> > "public: int * (__cdecl*__thiscall
>>> > itk::VTKImageExportBase::GetWholeExtentCallback(void)const )(void *)"
>>> > (?GetWholeExtentCallback at VTKImageExportBase@itk@@QBEP6APAHPAX at ZXZ)
>>> > referenced in function "protected: __thiscall
>>> > itk::ImageToVTKImageFilter<class itk::Image<short,3>
>>> >>::ImageToVTKImageFilter<class itk::Image<short,3> >(void)"
>>> > (??0?$ImageToVTKImageFilter at V?$Image at F$02 at itk@@@itk@@IAE at XZ)
>>> > 1>visualization_routines.obj : error LNK2019: unresolved external
>>> symbol
>>> > "public: int (__cdecl*__thiscall
>>> > itk::VTKImageExportBase::GetPipelineModifiedCallback(void)const )(void
>>> *)"
>>> > (?GetPipelineModifiedCallback at VTKImageExportBase@itk@@QBEP6AHPAX at ZXZ)
>>> > referenced in function "protected: __thiscall
>>> > itk::ImageToVTKImageFilter<class itk::Image<short,3>
>>> >>::ImageToVTKImageFilter<class itk::Image<short,3> >(void)"
>>> > (??0?$ImageToVTKImageFilter at V?$Image at F$02 at itk@@@itk@@IAE at XZ)
>>> > 1>visualization_routines.obj : error LNK2019: unresolved external
>>> symbol
>>> > "public: void (__cdecl*__thiscall
>>> > itk::VTKImageExportBase::GetUpdateInformationCallback(void)const )(void
>>> *)"
>>> > (?GetUpdateInformationCallback at VTKImageExportBase@itk@@QBEP6AXPAX at ZXZ)
>>> > referenced in function "protected: __thiscall
>>> > itk::ImageToVTKImageFilter<class itk::Image<short,3>
>>> >>::ImageToVTKImageFilter<class itk::Image<short,3> >(void)"
>>> > (??0?$ImageToVTKImageFilter at V?$Image at F$02 at itk@@@itk@@IAE at XZ)
>>> > 1>visualization_routines.obj : error LNK2019: unresolved external
>>> symbol
>>> > "protected: __thiscall
>>> itk::VTKImageExportBase::VTKImageExportBase(void)"
>>> > (??0VTKImageExportBase at itk@@IAE at XZ) referenced in function "protected:
>>> > __thiscall itk::VTKImageExport<class itk::Image<short,3>
>>> >>::VTKImageExport<class itk::Image<short,3> >(void)"
>>> > (??0?$VTKImageExport at V?$Image at F$02 at itk@@@itk@@IAE at XZ)
>>> > 1>visualization_routines.obj : error LNK2001: unresolved external
>>> symbol
>>> > "protected: virtual void __thiscall
>>> > itk::VTKImageExportBase::UpdateInformationCallback(void)"
>>> > (?UpdateInformationCallback at VTKImageExportBase@itk@@MAEXXZ)
>>> > 1>visualization_routines.obj : error LNK2001: unresolved external
>>> symbol
>>> > "protected: virtual int __thiscall
>>> > itk::VTKImageExportBase::PipelineModifiedCallback(void)"
>>> > (?PipelineModifiedCallback at VTKImageExportBase@itk@@MAEHXZ)
>>> > 1>visualization_routines.obj : error LNK2001: unresolved external
>>> symbol
>>> > "protected: virtual void __thiscall
>>> > itk::VTKImageExportBase::UpdateDataCallback(void)"
>>> > (?UpdateDataCallback at VTKImageExportBase@itk@@MAEXXZ)
>>> > 1>visualization_routines.obj : error LNK2001: unresolved external
>>> symbol
>>> > "protected: virtual void __thiscall
>>> itk::VTKImageExportBase::PrintSelf(class
>>> > std::basic_ostream<char,struct std::char_traits<char> > &,class
>>> > itk::Indent)const "
>>> > (?PrintSelf at VTKImageExportBase@itk@@MBEXAAV?$basic_ostream at DU
>>> ?$char_traits at D@std@@@std@@VIndent at 2@@Z)
>>> >
>>> > Don't know, what am I doing wrong?
>>> >
>>> >
>>> >
>>> > Best regards,
>>> >
>>> > Michal
>>> >
>>> > Faculty of Biomedical Engineering CTU
>>> >
>>> > _______________________________________________
>>> > Powered by www.kitware.com
>>> >
>>> > Visit other Kitware open-source projects at
>>> > http://www.kitware.com/opensource/opensource.html
>>> >
>>> > Please keep messages on-topic and check the VTK FAQ at:
>>> > http://www.vtk.org/Wiki/VTK_FAQ
>>> >
>>> > Follow this link to subscribe/unsubscribe:
>>> > http://www.vtk.org/mailman/listinfo/vtkusers
>>> >
>>> >
>>>
>>
>>
>>
>> --
>> S pozdravem Bc. Michal Srna
>>
>> Fotografické portfolio:
>> http://michalsrna.cz
>>
>
>
>
> --
> S pozdravem Bc. Michal Srna
>
> Fotografické portfolio:
> http://michalsrna.cz
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110411/2a336622/attachment.htm>


More information about the vtkusers mailing list