[Insight-users] Visual Studio 2008 and ITK libraries

Michael Jackson mike.jackson at bluequartz.net
Tue Jun 23 17:29:47 EDT 2009


Yes, Use CMake for your project. With just a few lines in a  
CMakeLists.txt file, CMake will generate a Visual Studio Solution file  
for you that will have all the necessary includes.

Of course the ITK folks _could_ make it easier by using includes like:

#include <itk/Common/itkArray.h> instead of
#include <itkArray.h>

But I am sure they have their reasons..

Just my 2 cents
Mike Jackson


On Jun 23, 2009, at 5:19 PM, Elena Molina wrote:

> Hi,
> thanks for your answer. There are a lot of include directories... Is  
> there another way?
> Thankss
>
> 2009/6/23 Michael Jackson <mike.jackson at bluequartz.net>
> You need to add all the proper ITK include directories from the ITK  
> installation directory to your Visual Studio project. There are a  
> lot of them to include.
> _________________________________________________________
> Mike Jackson                  mike.jackson at bluequartz.net
> BlueQuartz Software                    www.bluequartz.net
> Principal Software Engineer                  Dayton, Ohio
>
>
>
>
> On Jun 23, 2009, at 3:34 PM, Elena Molina wrote:
>
> Hi,
> I´m Elena. I´m starting with ITK libraries and i have this problem:
> I have created a project in VS2008 and I want to use ITK functions,
> so after building succesfully the ITK libraries (with Cmake), I´m
> trying to reference the ".h" from ITK in my source code in this
> way,
>
> #include "RegionGrowing.h"
>
> #include "itkConnectedThresholdImageFilter.h"
> #include "itkImage.h"
> #include "itkCastImageFilter.h"
> #include "itkCurvatureFlowImageFilter.h"
> #include "itkImageFileReader.h"
> #include "itkImageFileWriter.h"
>
>
>  but appear this error after building my project:
>
> cl -c RegionGrowing.cc (nt-win32)
> RegionGrowing.cc
> RegionGrowing.cc(16) : fatal error C1083: Cannot open include file:  
> 'itkConnectedThresholdImageFilter.h': No such file or directory
> make: *** [.release-nt5-msvc.obj/RegionGrowing.obj] Error 2
>
> I know that I have to include 'itkConnectedThresholdImageFilter.h'  
> in my project directory but I need to
> include a lot of them... Is there any way to reference ".h"? Must I  
> include "CMakelists.txt" in
> my project ?
>
> note: I have built my project with make.exe not Cmake.exe.
>
> Thankss!
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>



More information about the Insight-users mailing list