[ITK] ITK 4.5.1 include and lib paths

Armstrong, Hirotatsu HIROTATSU.ARMSTRONG at UCDENVER.EDU
Wed Apr 2 16:26:43 EDT 2014


Hey Matt,

Thanks for the info, I will give that a shot.  I am used to developing on linux so compiling in general has been tricky for me on Windows.  However, the ITK wiki was very useful.  Below I'll list the modifications I had to make to get it to compile on my setup...

==================
Windows 7 64-bit
minGW GCC/G++ 4.8.1
Cmake 2.8.12.2
ITK 4.5.1
==================

1) modify InsightToolkit-4.5.1\Modules\Filtering\ImageFilterBase\test\CMakeLists.txt to comment out
 if (DEFINED ITK_CXX_DISABLE_OPTIMIZATION_FLAG)
set_source_files_properties(
    itkCastImageFilterTest.cxx
    PROPERTIES COMPILE_FLAGS ${ITK_CXX_DISABLE_OPTIMIZATION_FLAG}
  )
The above lines were crashing compilation of itkCastImageFilterTest.cxx (this still compiled even when I disabled the make tests option during config?)

2) added the following typedefs...
	MinGW\include\io.h: line 301
	typedef _off64_t off64_t

	 MinGW\include\unistd.h: line 65
	typedef _off_t off_t

	InsightToolkit-4.5.1\Modules\ThirdParty\HDF5\src\itkhdf5\src\H5Ppublic.h: line 299
	typedef _off_t off_t

these typedefs are already defined in minGW/include/sys/types.h, but are wrapped in the compiler directives
#ifndef __STRICT_ANSI__
typedef __int64 off64_t;
#endif /* __STRICT_ANSI__ */

#ifndef __STRICT_ANSI__
typedef _off_t	off_t;
#endif /* __STRICT_ANSI__ */

So I modified the above files rather than types.h.  Those changes seemed let it compile fine.



-----Original Message-----
From: Matt McCormick [mailto:matt.mccormick at kitware.com] 
Sent: Wednesday, April 02, 2014 2:06 PM
To: Armstrong, Hirotatsu
Cc: community at itk.org
Subject: Re: [ITK] ITK 4.5.1 include and lib paths

Hi James,

Welcome to ITK!

Are there are any experiences with your MinGW build that we can use to improve the experience for others?

When building against ITK, it is highly recommended to use CMake to generate your project.  To create a Code::Blocks project with CMake, select "CodeBlocks - MinGW Makefiles" as the CMake generator.

Otherwise, the include directories and libraries can be found by creating by creating a small CMake project:

  cmake_minimum_required( VERSION 2.8 )
  find_package( ITK REQUIRED )
  message( "ITK_LIBRARIES: ${ITK_LIBRARIES}" )
  message( "ITK_INCLUDE_DIRS: ${ITK_INCLUDE_DIRS}" )
  message( "ITK_LIBRARY_DIRS: ${ITK_LIBRARY_DIRS}" )

Hope this helps,
Matt

On Wed, Apr 2, 2014 at 3:42 PM, Armstrong, Hirotatsu <HIROTATSU.ARMSTRONG at ucdenver.edu> wrote:
> Hello forum,
>
>
>
> I have been working on installing ITK over the past few days, and 
> finally got it to fully compile using minGW.  I downloaded ITK to C:\
> InsightToolkit-4.5.1 and built into C:\ITK-4.5.1.  I develop using 
> code::blocks and want to include ITK in a project, but cannot find any 
> information on all the directories I need.  Could anyone give me a 
> complete list of all include and lib paths needed to use ITK?  Thanks
>
>
>
> James Armstrong, Ph.D.
>
> PostDoctoral Fellow, Physics
>
> Department of Radiation Oncology
>
> University of Colorado School of Medicine
>
> 1665 Aurora Ct, MS F706
>
> Aurora, CO 80045
>
> 720-848-0257
>
>
>
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/community
>



More information about the Community mailing list