[Insight-developers] Can't find itkpng.lib; don't need it anyway.

Mark Foskey foskey@cs.unc.edu
Wed, 18 Sep 2002 14:07:46 -0400


Thanks and apologies -- I sent that just a day or so before the 
discussion about the single bin/lib directory picked back up, but it got 
held up because of a problem in my email configuration.  So I realized 
already that my question had been rendered moot.

Luis Ibanez wrote:
> 
> Hi Mark,
> 
> itkpng.lib is added to the link list because the ImageIOFactories
> have several file formats registered by default.
> 
> The defaults are: { PNG, MetaImage, Dicom, VTK }
> 
> As long as you use any IO in your program, the libraries
> associated with these default formats will enter into the
> dependencies.
> 
> The need for the LINK_DIRECTORIES will be solved by the
> current ongoing process of placing all libraries and
> executables in a single common directory.
> 
> You shouldn't need to add "Debug" to the paths.
> The CMakeLists.txt files are independent of the build
> configuration.
> 
> 
>    Luis
> 
> 
> 
> 
> ===========================================================
> Mark Foskey wrote:
> 
>> When I try to compile using the .dsw file from the CMakeLists.txt file 
>> appended below, I get the message:
>>
>> LINK : fatal error LNK1181: cannot open input file "itkpng.lib"
>>
>> This is puzzling since I'm not using itkpng.lib.
>>
>> I assume that a workaround for the problem is to add the appropriate 
>> directory under LINK_DIRECTORIES, but I don't think users should need 
>> to do that explicitly, at least if they're not explicitly requesting 
>> itkpng.lib.
>>
>> Also, I had to add the "Debug" at the end of 
>> ${ITK_BINARY_DIR}/Code/IO/Debug to avoid an error, and that doesn't 
>> seem right eiter.
>>
>> Are these the right behaviors?
>>
>> The CMakeLists.txt file:
>>
>> PROJECT(DicomMod)
>>
>> # Find ITK
>> INCLUDE (${CMAKE_ROOT}/Modules/FindITK.cmake)
>> IF (USE_ITK_FILE)
>>   INCLUDE (${USE_ITK_FILE})
>> ENDIF (USE_ITK_FILE)
>>
>> #indicate directores and libraries
>>
>> INCLUDE_DIRECTORIES(
>> ${ITK_SOURCE_DIR}/Code/IO
>> )
>>
>> LINK_DIRECTORIES(
>> ${ITK_BINARY_DIR}/Code/IO/Debug
>> )
>>
>> LINK_LIBRARIES (
>> ITKIO
>> )
>>
>> #specify executables
>> ADD_EXECUTABLE(itkDicomImageIOTest itkDicomImageIOTest)
>>
>>
> 
> 
> 


-- 
Mark Foskey    (919) 843-5436  Computer-Aided Diagnosis and Display Lab
mark_foskey@unc.edu            Department of Radiology, CB 7515, UNC
http://www.cs.unc.edu/~foskey  Chapel Hill, NC  27599-7515