[Insight-users] link error

Yannick Pannier pannier at lms.polytechnique.fr
Tue Mar 11 05:07:09 EDT 2008


Hi Luis,

Thanks to your remarks I've found the mistake. I'm beginner in CMake. 
I've several builds of ITK (different releases) on my machine, so I've  
decided to manually pass ITK INCLUDE and LINK directories in CMake, but 
I was keeping the find ITK macro on top of my CMakeLists.txt, and it was 
pointing (by default) on the wrong ITK directories.
Now, I've just keeped the ITK find macro, and configure the right 
directory in ccmake.
It is very simple and usefull !!
Regards,
Yannick
Luis Ibanez a écrit :
>
> Hi Yannick,
>
> Apparently you are missing to link to "itksys".
>
> What is strange in your report is that you mention
> that you are configuring your project using CMake.
>
> If that is the case, CMake should have anticipated
> the dependency between any ITK library and "itksys"
> and should have added "itksys" to the list of libraries
> to link with.
>
> In other words, we have never found necessary to explicitly
> add "itksys" to the list of libraries in a CMake command
>
>     TARGET_LINK_LIBRARIES(target libraries)
>
> when we have already listed any of the ITK libraries in
> that command.
>
>
> Something else may be going on with your build....
>
>
> Are you doing this on Unix/Linux ?
>
> Are you explicitly adding all the libraries that
> you mentioned below ?
>
> If so, you may be adding them in an incorrect order.
>
> Please post to the list the TARGET_LINK_LIBRARIES()
> command of your executable.
>
>
>   Thanks
>
>
>
>       Luis
>
>
> ---------------------
> Yannick Pannier wrote:
>> Hi,
>>
>> When trying to compile my project (configured with cmake), I've got 
>> the following linkage error.
>>
>> In function `itk::ImageFileReader<itk::Image<unsigned short, 3u>, 
>> itk::DefaultConvertPixelTraits<unsigned short> 
>>  >::TestFileExistanceAndReadability()':
>> menus.cxx:(.text._ZN3itk15ImageFileReaderINS_5ImageItLj3EEENS_25DefaultConvertPixelTraitsItEEE31TestFileExistanceAndReadabilityEv[itk::ImageFileReader<itk::Image<unsigned 
>> short, 3u>, itk::DefaultConvertPixelTraits<unsigned short> 
>>  >::TestFileExistanceAndReadability()]+0x26): undefined reference to 
>> `itksys::SystemTools::FileExists(char const*, bool)'
>>
>> Can somebody tell me which library to link with ?
>> I've already linked with :
>> ITKCommon ITKNumerics ITKIO ITKMetaIO ITKAlgorithms
>>    ITKNrrdIO itkgdcm itkjpeg12 itkjpeg16 itkopenjpeg
>>    itkpng itktiff itkjpeg8 ITKSpatialObject ITKNumerics
>>    itkvnl_inst itkvnl_algo itkv3p_netlib itkvnl itkvcl
>>    pthread itksys dl ITKDICOMParser ITKEXPAT
>>    ITKniftiio ITKznz itkzlib -Wl itkvnl_algo itkv3p_netlib
>>
>> Thanks,
>>
>> Yan
>>
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>
>


-- 
 -----------------------------------------------
  Yannick Pannier
  Post Doctorant CNRS 
  Laboratoire de Mécanique des Solides UMR7649
  Ecole Polytechnique, 91128 Palaiseau Cedex
  mel : pannier at lms.polytechnique.fr
  tel : (33/0)1 69 33 58 04
	(33/0)6 28 18 69 53
  fax : (33/0)1 69 33 57 06
 -----------------------------------------------



More information about the Insight-users mailing list