[Insight-users] Compiling ITK on Windows

Raghavendra Chandrashekara rc3@doc.ic.ac.uk
Tue, 4 Mar 2003 18:32:30 -0000


> Your CMakeLists.txt file looks good.
>
> In principle ITKIO should pull itkpng and itkzlib, but...
> since all the unresolved symbols are related with PNG,
> we may suspect that itkpng is not being added to the
> link line.
>
> Pleawse try adding "itkpng" and "itkzlib" to your CMakeLists.txt
> file, something like the following line should do it:
>
> TARGET_LINK_LIBRARIES(ITKGIPLImageTest
> ITKIO
> ITKCommon
> ITKMetaIO
> VXLNumerics
> itkpng
> itkzlib
> )

Okay I tried this but unfortunately it didn't work. I also checked the
project properties in VS.NET. These are the linker options which are being
used:

/OUT:"Debug\ITKGIPLImageTest.exe" /INCREMENTAL:NO /NOLOGO
/LIBPATH:"I:\packages\InsightCVS\Windows\VS.NET\bin\.\Debug"
/LIBPATH:"I:\packages\InsightCVS\Windows\VS.NET\bin\\" /DEBUG
/PDB:"Debug\ITKGIPLImageTest.pdb" /SUBSYSTEM:CONSOLE /STACK:10000000
odbc32.lib odbccp32.lib ITKIO.lib ITKCommon.lib ITKMetaIO.lib
VXLNumerics.lib itkpng.lib itkzlib.lib ITKDICOMParser.lib   kernel32.lib
user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

Looks like the correct path is set, and the libraries are being linked.

>
> Also,
> just being a bit paranoid, could you please go to the
> "bin" directory inside the binary directory where you build ITK
> and verify that "itkpng.lib" and "itkzlib.lib" are there ?

Yep, the libraries are there in the bin/debug directory.

> and... being even more paranoid:
>
> did you moved the binary directory after finishing building ITK ?

Nope, they are in the original directories.

I also tried compiling the project in Linux and that executable was built
properly. But when I ran the program it crashed. I would like to be able to
build it on Windows so that I can debug it and find exactly the source of
the problem.

Thanks,

Raghavendra.