[Insight-users] Wrapping link errors for Examples

Luis Ibanez luis.ibanez at kitware.com
Thu, 05 Feb 2004 16:48:23 -0500


Hi John,

Thanks for the clarification.

A common mistake in this situation is to
first build ITK with Static Libraries and
the switch to Shared libraries without
first cleaning the build.

That results in a mixture of shared and
static libraries being available in your
ITKBINDIR/bin directory.


Could you please try the following:

1) remove all the content of the
    ITKBINDIR/bin directory,

2) do "clean" in BUILD_ALL

3) rebuild


Please let us know if you still have
problems after rebuilding.


Thanks


   Luis


----------------------
anast.jm at pg.com wrote:

> 
> Luis...oops I left out a key word in the fIrst build TCL 
> WRAPPING=OFF...sorry about that...any help appreciated...john
> 
>  > I've built ITK 1.6.0 on MSVC6 (Win2K) with tcl wrapping OFF with no 
> errors
>  > (build testing/examples turned on), but when I turn on tcl wrapping I
>  > get the following link errors
> 
> 
> 
> 	*Luis Ibanez <luis.ibanez at kitware.com>*
> Sent by: insight-users-admin at itk.org
> 
> 02/04/2004 07:21 PM
> 
> 	       
>         To:        John Anast-JM/PGI at PGI
>         cc:        insight-users at itk.org
>         Subject:        Re: [Insight-users] Wrapping link errors for 
> Examples
> 
> 
> 
> 
> 
> Hi John,
> 
> Can you please clarify something in your email,
> 
> You said:
> 
>  > I've built ITK 1.6.0 on MSVC6 (Win2K) with tcl wrapping with no errors
>  > (build testing/examples turned on), but when I turn on tcl wrapping I
>  > get the following link errors
> 
> 
> I couldn'f figure out the difference between the
> first built and the second. In the first case you
> are building
> 
>    TCL WRAPPING   = ON
>    EXAMPLES       = ON
>    TESTING        = ON
> 
>    Get erros      = No
> 
> While in the second you are building
> 
>    TCL WRAPPING   = ON
>    EXAMPLES       = ON
>    TESTING        = ON
> 
>    Get errors     = yes
> 
> 
> Please give us a hint,
> 
> 
> Thanks
> 
> 
>   Luis
> 
> 
> ----------------------------
> anast.jm at pg.com wrote:
> 
>  >
>  > I've built ITK 1.6.0 on MSVC6 (Win2K) with tcl wrapping with no errors
>  > (build testing/examples turned on), but when I turn on tcl wrapping I
>  > get the following link errors for Segmentation Examples...any ideas. If
>  > I turn off examples it builds with no errors. I downloaded and built
>  > CableSwig-ITK-1.6.0 (with no errors). Am using cmake 1.8p3. I can send
>  > cmakelist.txt if needed. I didn't get any hits in the FAQ or the
>  > userlist...thanks, john
>  >
>  > p.s. I downloaded the gz files not the zips just to be sure IE didn't
>  > mess em up...
>  >
>  > --------------------Configuration: SegmentationExamples - Win32
>  > Release--------------------
>  > Compiling...
>  > SegmentationExamples.cxx
>  > Linking...
>  >    Creating library P:\AnastDev\Insight
>  > 160\In160\bin\Release/SegmentationExamples.lib and object
>  > P:\AnastDev\Insight 160\In160\bin\Release/SegmentationExamples.exp
>  > --------------------Configuration: SegmentationExamples2 - Win32
>  > Release--------------------
>  > Linking...
>  > ITKCommon.lib(ITKCommon.dll) : error LNK2005: "public: virtual
>  > __thiscall itk::ExceptionObject::~ExceptionObject(void)"
>  > (??1ExceptionObject at itk at  at UAE at XZ) already defined in
>  > SegmentationExamples2.obj
>  > ITKCommon.lib(ITKCommon.dll) : error LNK2005: "protected: void
>  > __thiscall itk::ExceptionObject::UpdateWhat(void)"
>  > (?UpdateWhat at ExceptionObject at itk at  at IAEXXZ) already defined in
>  > SegmentationExamples2.obj
>  > ITKCommon.lib(ITKCommon.dll) : error LNK2005: "public: __thiscall
>  > itk::ExceptionObject::ExceptionObject(class itk::ExceptionObject const
>  > &)" (??0ExceptionObject at itk at  at QAE at ABV01 at  at Z) already defined in
>  > SegmentationExamples2.obj
>  > ITKCommon.lib(ITKCommon.dll) : error LNK2005: "public: __thiscall
>  > itk::ExceptionObject::ExceptionObject(char const *,unsigned int,char
>  > const *,char const *)" (??0ExceptionObject at itk at  at QAE at PBDI00 at Z) already
>  > defined in SegmentationExamples2.obj
>  > ITKCommon.lib(ITKCommon.dll) : warning LNK4006: "public: virtual
>  > __thiscall itk::ExceptionObject::~ExceptionObject(void)"
>  > (??1ExceptionObject at itk at  at UAE at XZ) already defined in
>  > SegmentationExamples2.obj; second definition ignored
>  > ITKCommon.lib(ITKCommon.dll) : warning LNK4006: "protected: void
>  > __thiscall itk::ExceptionObject::UpdateWhat(void)"
>  > (?UpdateWhat at ExceptionObject at itk at  at IAEXXZ) already defined in
>  > SegmentationExamples2.obj; second definition ignored
>  > ITKCommon.lib(ITKCommon.dll) : warning LNK4006: "public: __thiscall
>  > itk::ExceptionObject::ExceptionObject(class itk::ExceptionObject const
>  > &)" (??0ExceptionObject at itk at  at QAE at ABV01 at  at Z) already defined in
>  > SegmentationExamples2.obj; second definition ign
>  > ored
>  > ITKCommon.lib(ITKCommon.dll) : warning LNK4006: "public: __thiscall
>  > itk::ExceptionObject::ExceptionObject(char const *,unsigned int,char
>  > const *,char const *)" (??0ExceptionObject at itk at  at QAE at PBDI00 at Z) already
>  > defined in SegmentationExamples2.obj; seco
>  > nd definition ignored
>  >    Creating library P:\AnastDev\Insight
>  > 160\In160\bin\Release/SegmentationExamples2.lib and object
>  > P:\AnastDev\Insight 160\In160\bin\Release/SegmentationExamples2.exp
>  > SegmentationExamples2.obj : error LNK2001: unresolved external symbol
>  > "public: static float const itk::NumericTraits<float>::Zero"
>  > (?Zero at ?$NumericTraits at M at itk at  at 2MB)
>  > SegmentationExamples2.obj : error LNK2001: unresolved external symbol
>  > "public: static double const itk::NumericTraits<double>::Zero"
>  > (?Zero at ?$NumericTraits at N at itk at  at 2NB)
>  > SegmentationExamples2.obj : error LNK2001: unresolved external symbol
>  > "public: static unsigned char const itk::NumericTraits<unsigned
>  > char>::Zero" (?Zero at ?$NumericTraits at E at itk at  at 2EB)
>  > SegmentationExamples2.obj : error LNK2001: unresolved external symbol
>  > "public: static float const itk::NumericTraits<float>::One"
>  > (?One at ?$NumericTraits at M at itk at  at 2MB)
>  > SegmentationExamples2.obj : error LNK2001: unresolved external symbol
>  > "public: static double const itk::NumericTraits<double>::One"
>  > (?One at ?$NumericTraits at N at itk at  at 2NB)
>  > P:\AnastDev\Insight 160\In160\bin\Release/SegmentationExamples2.exe :
>  > fatal error LNK1120: 5 unresolved externals
>  > Error executing link.exe.
> 
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
>