[Insight-users] Using ITK with visual studio and not cmake

Mark Roden mmroden at gmail.com
Mon Oct 19 12:14:58 EDT 2009


Hi all,

I want to incorporate more libraries than just itk in my project, and
am having a pretty hard time of it.

I've built the libraries using the cmake options to build only libraries.

I then have a basic hello-world executable that links to the built
libraries and includes the itk/code/common directory.

I then #include "itkImage.h" at the top of my main file, and have the
body of the main function matching the example from HelloWorld.cxx in
examples/installation

When I try to build, I get this error:

1>c:\users\mark\src\itktests\itktestproject\itk
libraries\code\common\itkwin32header.h(23) : fatal error C1083: Cannot
open include file: 'itkConfigure.h': No such file or directory

How do I fix this?  I can't find the itkConfigure.h file anywhere;
does cmake not make it automatically?

Also, I see that the following errors have been commented out using
the visual studio compiler:

// 'conversion' conversion from 'type1' to 'type2', possible loss of data
#pragma warning ( disable : 4244 )

// 'conversion' : truncation of constant value
#pragma warning ( disable : 4309 )

// 'type' : forcing value to bool 'true' or 'false' (performance warning)
#pragma warning ( disable : 4800 )

// 'identifier' : class 'type' needs to have dll-interface to be used by
// clients of class 'type2'
#pragma warning ( disable : 4251 )

// non dll-interface class 'type' used as base for dll-interface class 'type2'
#pragma warning ( disable : 4275 )

// conditional expression is constant
#pragma warning ( disable : 4127 )

// unreferenced local function has been removed
#pragma warning ( disable : 4505 )

In my experience, these are all extremely useful warnings, because
they usually tell me where I've got performance problems, I've
truncated pi or e or some other constant and so may get inconsistent
results, or I'm truncating without an explicit cast and therefore
running the risk of losing real information.  Should I turn those on
and fix the warnings, or are they all there because those same lines
don't have problems with gcc?

This is windows 7 x86, although I would like to switch to 64 bits
shortly.  If it should Just Work in 64 bits, I'll make the transition
now.

Thanks,
Mark


More information about the Insight-users mailing list