[Insight-users] Linkage errors concerning Watershed Filter

Luis Ibanez luis . ibanez at kitware . com
Tue, 19 Aug 2003 10:50:24 -0400


Hi Zhao,

You seem to be mixing .obj modules compiled for Debug
with othere modules compiled for Release.

Please recompile all your libraries and .obj for the
same compilation mode.

You could avoid this basic problems if you use CMake
for configuring your projects.


Regards,


   Luis


------------------------------------------

Zhaocg wrote:
> Hi Friends,
> 
> Firstly, thanks Luis for explaining the Observer/Command pattern.
> 
> Now  I encounter a linkage error under VC: when I include "itkWatershedImageFilter.h" in two different *.cpp file, linkage errors appear:
> 
> lobals.obj : error LNK2005: "public: bool __thiscall itk::watershed::OneWayEquivalencyTable::Add(unsigned long,unsigned long)" (?Add at OneWayEquivalencyTable@watershed at itk@@QAE_NKK at Z) already defined in CBIRDoc.obj
> globals.obj : error LNK2005: "public: void __thiscall itk::watershed::OneWayEquivalencyTable::Flatten(void)" (?Flatten at OneWayEquivalencyTable@watershed at itk@@QAEXXZ) already defined in CBIRDoc.obj
> globals.obj : error LNK2005: "public: unsigned long __thiscall itk::watershed::OneWayEquivalencyTable::RecursiveLookup(unsigned int)const " (?RecursiveLookup at OneWayEquivalencyTable@watershed at itk@@QBEKI at Z) already defined in CBIRDoc.obj
> globals.obj : error LNK2005: "protected: virtual void __thiscall itk::watershed::OneWayEquivalencyTable::UpdateOutputInformation(void)" (?UpdateOutputInformation at OneWayEquivalencyTable@watershed at itk@@MAEXXZ) already defined in CBIRDoc.obj
> 
> ......... and so on.
> 
> How to solve this probelm? Any indication will be appreciated. :)
> 
> Zhao
> 
> "{"‚n±ê왨¥Šx%ŠËHžÈ †Û¬z»"¶J+‚m§ÿðí’Šàþf¢–f§þX¬¶)ߣø§²(!¶ërs==