[Insight-users] Linking ITK 2.4.1 to an application and GDCM
related errors
Mathieu Malaterre
mathieu.malaterre at kitware.com
Thu Feb 9 09:36:26 EST 2006
Stefan Wesarg wrote:
> Hello,
>
> We have our own application that uses ITK functionality. Currently we
> are upgrading the ITK part from 2.0.1 to 2.4.1. Up to now everything
> worked fine with the old 2.0.1 version. Linking against the new 2.4.1
> libraries results in an unresolved external linker error related to the
> GDCM library:
>
>> itkgdcm.lib(gdcmUtil.obj) : error LNK2001: unresolved external symbol
>> _SnmpUtilVarBindFree at 4
>> itkgdcm.lib(gdcmUtil.obj) : error LNK2001: unresolved external symbol
>> _SnmpUtilOidNCmp at 12
>> itkgdcm.lib(gdcmUtil.obj) : error LNK2001: unresolved external symbol
>> _SnmpUtilOidCpy at 8
>
>
> However, we are not using GDCM explicitely. All stuff that is DICOM
> related and that we are using is related to these classes:
>
>> #include <itkDICOMSeriesFileNames.h>
>> #include <itkDICOMImageIO.h>
>> #include <itkDICOMImageIO2.h>
>
>
> Can anybody give me some hints what the problem could be? How GDCM comes
> into play if we do not use that functionality?
That's magic ;)
Simply because the API of itkGDCM was updated to match the one from
itkDICOM and then all you need is make itkDICOM an empty subclass of
itkGDCM.
As for your linker error, indeed GDCM needs some functionalities from
snmpapi to access the IP address of the machine (I always wanted to
rewrite this code but never got a chance doing it). Anyway the link
should be done properly. By any chance are you reusing an old binary
tree, with a different source tree ? If so could you please try again in
a fresh new build tree ?
$ grep -3 snmp Utilities/gdcm/src/CMakeLists.txt
IF(WIN32)
IF(NOT BORLAND)
TARGET_LINK_LIBRARIES(itkgdcm wsock32 snmpapi)
ENDIF(NOT BORLAND)
ENDIF(WIN32)
> Our configuration:
> OS: Win XP, Prof.
> Compiler: Visual C++ 6
> other toolkits used: VTK 4.4 and wxWidgets 2.4.2
^^^^^^^^ nice :)
Mathieu
More information about the Insight-users
mailing list