[Insight-users] missing libraries in Link line

Luis Ibanez luis.ibanez@kitware.com
Mon, 14 Apr 2003 15:51:06 -0400


Hi Helder,

Your linking problems are unrelated to VTK.

The errors are probably produced because you are
loading the projects in one of the subdirectories
instead of loading the .dsw file at the top directory.

If you want to build the examples as isolated executables,
you may have to copy them in an external directory and
configure a CMakeLists.txt file for them.

Please follow the example of the CMakeLists.txt file in:


    Insight/Examples/Installation


Make sure that you add the libraries ITKIO, MetaImageIO,
itkpng and itkzlib. (they are the immediate culprits of the
unresolved symbol messages that you are getting).



Regards



  Luis



---------------------
Helder Carvalho wrote:


>>> when  i tried to build the 
>>> project.dsw i got, from making the cmake of the examples folder on 
>>> ITK i get the following linking errors, i got no errors when i built 
>>> the ITK project but i got this while triyngo to built the individual 
>>> examples folder:
>>>
>>>
>>>
>>>
>>> "--------------------Configuration: Image2 - Win32 
>>> Debug--------------------
>>> Linking...
>>>   Creating library Debug/Image2.lib and object Debug/Image2.exp
>>> ITKIO.lib(itkAnalyzeImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _gzclose
>>> ITKIO.lib(itkAnalyzeImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _gzread
>>> ITKIO.lib(itkAnalyzeImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _gzopen
>>> ITKIO.lib(itkAnalyzeImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _gzwrite
>>> ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external 
>>> symbol "public: virtual __thiscall MetaImage::~MetaImage(void)" 
>>> (??1MetaImage@@UAE@XZ)
>>> ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external 
>>> symbol "bool __cdecl MET_SystemByteOrderMSB(void)" 
>>> (?MET_SystemByteOrderMSB@@YA_NXZ)
>>> ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external 
>>> symbol "public: __thiscall MetaImage::MetaImage(void)" 
>>> (??0MetaImage@@QAE@XZ)
>>> ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external 
>>> symbol "public: void __thiscall MetaImage::ElementDataFileName(char 
>>> const *)" (?ElementDataFileName@MetaImage@@QAEXPBD@Z)
>>> ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external 
>>> symbol "public: float __thiscall MetaObject::Position(int)const " 
>>> (?Position@MetaObject@@QBEMH@Z)
>>> ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external 
>>> symbol "public: float __thiscall MetaObject::ElementSpacing(int)const 
>>> " (?ElementSpacing@MetaObject@@QBEMH@Z)
>>> ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external 
>>> symbol "public: int __thiscall MetaImage::DimSize(int)const " 
>>> (?DimSize@MetaImage@@QBEHH@Z)
>>> ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external 
>>> symbol "public: int __thiscall MetaObject::NDims(void)const " 
>>> (?NDims@MetaObject@@QBEHXZ)
>>> ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external 
>>> symbol "public: enum MET_ValueEnumType  __thiscall 
>>> MetaImage::ElementType(void)const " 
>>> (?ElementType@MetaImage@@QBE?AW4MET_ValueEnumType@@XZ)
>>> ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external 
>>> symbol "public: int __thiscall 
>>> MetaImage::ElementNumberOfChannels(void)const " 
>>> (?ElementNumberOfChannels@MetaImage@@QBEHXZ)
>>> ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external 
>>> symbol "public: bool __thiscall MetaObject::BinaryData(void)const " 
>>> (?BinaryData@MetaObject@@QBE_NXZ)
>>> ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external 
>>> symbol "public: bool __thiscall MetaImage::ElementByteOrderFix(void)" 
>>> (?ElementByteOrderFix@MetaImage@@QAE_NXZ)
>>> ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external 
>>> symbol "public: char const * __thiscall 
>>> MetaImage::ElementDataFileName(void)const " 
>>> (?ElementDataFileName@MetaImage@@QBEPBDXZ)
>>> ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external 
>>> symbol "public: void __thiscall MetaObject::BinaryData(bool)" 
>>> (?BinaryData@MetaObject@@QAEX_N@Z)
>>> ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external 
>>> symbol "public: void __thiscall MetaObject::Position(float const *)" 
>>> (?Position@MetaObject@@QAEXPBM@Z)
>>> ITKIO.lib(itkMetaImageIO.obj) : error LNK2001: unresolved external 
>>> symbol "public: bool __thiscall 
>>> MetaImage::InitializeEssential(int,int const *,float const *,enum 
>>> MET_ValueEnumType,int,void *,bool)" 
>>> (?InitializeEssential@MetaImage@@QAE_NHPBHPBMW4M
>>> ET_ValueEnumType@@HPAX_N@Z)
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_destroy_read_struct
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_create_info_struct
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_create_read_struct
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_sig_cmp
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_read_end
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_read_image
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_get_rowbytes
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_read_update_info
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_set_swap
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_set_tRNS_to_alpha
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_get_valid
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_set_gray_1_2_4_to_8
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_set_palette_to_rgb
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_get_IHDR
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_read_info
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_set_sig_bytes
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_init_io
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_get_sCAL
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_get_channels
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_write_end
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_write_image
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_write_info
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_set_sCAL
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_set_compression_level
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_set_IHDR
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_destroy_write_struct
>>> ITKIO.lib(itkPNGImageIO.obj) : error LNK2001: unresolved external 
>>> symbol _png_create_write_struct
>>> Debug/Image2.exe : fatal error LNK1120: 47 unresolved externals
>>> Error executing link.exe.
>>>
>>> ALL_BUILD - 48 error(s), 0 warning(s)
>>>
>>> Can you please help me with this.
>>> Sorry to bother you so much,
>>> Best regards,
>>>
>>> Helder
>>>
>>>
>>>
>>>
>>>
>>>
>>>> From: Luis Ibanez <luis.ibanez@kitware.com>
>>>> To: Helder Carvalho <hel_carvalho@hotmail.com>,   
>>>> Insight-users@public.kitware.com
>>>> Subject: Re: [Insight-users] failed to connect ITK with VTK
>>>> Date: Sat, 12 Apr 2003 02:36:32 -0400
>>>>
>>>>
>>>> Hi Helder,
>>>>
>>>> VTK 4.2 and the CVS version *do* use CMake for configuration.
>>>>
>>>> You may not be following the build instructions correctly.
>>>>
>>>> Note that in the VTK source tree that you obtain from CVS
>>>> there is a CMakeLists.txt file on each directory. The the
>>>> footprint of CMake  :-)
>>>>
>>>> Please configure VTK with CMake (you will need CMake 1.6.5)
>>>>
>>>>
>>>> Regards,
>>>>
>>>>
>>>>    Luis
>>>>
>>>>
>>>> -----------------------------------------
>>>> Helder Carvalho wrote:
>>>>
>>>>> hi Luis,
>>>>>
>>>>> I tried to change the CMake flag to put the VTK_USE_ANSI_STDLIB ON, 
>>>>> but there were no option available to do so. So the next step i 
>>>>> took,was to download VTK 4.2 by CVS. This new VTK does not need 
>>>>> CMake it compiles with nmake so there are no files related to 
>>>>> Cmake, the good news were that there was a option to build VTK with 
>>>>> the ANSI_STDLIB.
>>>>> After that I tried the InsightApplications CMake but it asks for 
>>>>> the VTKconfig.cmake file if someone needs to interact with VTK, 
>>>>> this file does not exists because vtk does not need CMAke,so itīs 
>>>>> not possible to build the applications interacting with VTK. What 
>>>>> can i do now??
>>>>>
>>>>> regards,
>>>>> Helder
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>> _________________________________________________________________
>>> Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
>>> http://join.msn.com/?page=features/featuredemail
>>>
>>>
>>
>>
>>
> H
> 
> _________________________________________________________________
> STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
> http://join.msn.com/?page=features/junkmail
> 
>