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

Bc. Michal Srna michal at srna.info
Mon Apr 11 12:00:09 EDT 2011


Thanks a lot man, I have run again cmake and turned on ITKGroup_Bridge flag,
created all  libs and now also those needed by ImageToVTKImageFilter.

It also SOLVED the problem I was asking you in topic Trying to connect ITK -
VTK - ITK about crashing when connecting ITK pipeline into VTK one.

Thanks one more time!

2011/4/11 Bill Lorensen <bill.lorensen at gmail.com>

> There is no ITKBasicFilters lib in the new layout. itkVTKImageExportBase is
> in the ITK-Bridge library. To build this library you will need top run cmake
> and turn on the ITKGroup_Bridge flag.
>
> There is some documentation here:
> http://itk.org/Wiki/ITK_Release_4/Modularization/Configure_and_build_ITK
>
> Bill
>
>
> On Mon, Apr 11, 2011 at 10:49 AM, Bc. Michal Srna <michal at srna.info>wrote:
>
>> Thanks Bill, it's true, but in the /lib of ITKv4 in in my build tree I
>> have those libs:
>>
>> ITK-Common-4.0.lib
>> ITKEXPAT-4.0.lib
>> itkgdcmCommon-4.0.lib
>> itkgdcmDICT-4.0.lib
>> itkgdcmDSED-4.0.lib
>> itkgdcmIOD-4.0.lib
>> itkgdcmjpeg12-4.0.lib
>> itkgdcmjpeg16-4.0.lib
>> itkgdcmjpeg8-4.0.lib
>> itkgdcmMSFF-4.0.lib
>> ITK-IO-Base-4.0.lib
>> ITK-IO-BioRad-4.0.lib
>> ITK-IO-BMP-4.0.lib
>> ITK-IO-GDCM-4.0.lib
>> ITK-IO-GIPL-4.0.lib
>> ITK-IO-JPEG-4.0.lib
>> ITK-IO-LSM-4.0.lib
>> ITK-IO-Meta-4.0.lib
>> ITK-IO-NIFTI-4.0.lib
>> ITK-IO-NRRD-4.0.lib
>> ITK-IO-PNG-4.0.lib
>> ITK-IO-Stimulate-4.0.lib
>> ITK-IO-TIFF-4.0.lib
>> ITK-IO-VTK-4.0.lib
>> itkjpeg-4.0.lib
>> ITK-Mesh-4.0.lib
>> ITKMetaIO-4.0.lib
>> itkNetlibSlatec-4.0.lib
>> ITKniftiio-4.0.lib
>> ITKNrrdIO-4.0.lib
>> itkopenjpeg-4.0.lib
>> itkpng-4.0.lib
>> ITK-QuadEdgeMesh-4.0.lib
>> ITK-SpatialObjects-4.0.lib
>> ITK-Statistics-4.0.lib
>> itksys-4.0.lib
>> itkTestDriver.lib
>> itktestlib-4.0.lib
>> itktiff-4.0.lib
>> ITK-Transform-4.0.lib
>> itkv3p_lsqr-4.0.lib
>> itkv3p_netlib-4.0.lib
>> itkvcl-4.0.lib
>> itkvnl_algo-4.0.lib
>> itkvnl-4.0.lib
>> ITK-VNLInstantiation-4.0.lib
>> itkzlib-4.0.lib
>> ITKznz-4.0.lib
>>
>> And as you can see, there is no ITKBasicFilters. Mayby it has to be set in
>> CMake before compiling ITKv4?
>>
>> That is why I need to use ITKBasicFilters.lib from ITK 3.2.
>>
>>
>> 2011/4/11 Bill Lorensen <bill.lorensen at gmail.com>
>>
>>> 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
>>>>
>>>>
>>>
>>
>>
>> --
>> S pozdravem Bc. Michal Srna
>>
>> Fotografické portfolio:
>> http://michalsrna.cz
>>
>
>


-- 
S pozdravem Bc. Michal Srna

Fotografické portfolio:
http://michalsrna.cz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110411/db99e9ec/attachment.htm>


More information about the Insight-users mailing list