[Insight-users] trouble setting ITK_DIR : cannot find itkImage.h
David Doria
daviddoria at gmail.com
Sun Jun 10 11:13:23 EDT 2012
On Sun, Jun 10, 2012 at 11:08 AM, Pratik Talole <pratiktalole at gmail.com>wrote:
> David,
>
> I printed out my environment during build. The build log shows that ITK_DIR
> is indeed set correctly to "ITK_DIR = F:\ITK_jun1\bin"
>
> Could the problem then not be with ITK_DIR?
>
> This is what I did :
>
> I first created a HelloWorld project using the CMakeLists file (keeping
> $(ITK_LIBRARIES)). This created two projects, an executable and a lib
> sharing the same source files. I added my ITK code to the source files
> here.
> I ran the executable, and built the lib. It was successful.
>
> Then I created a new console application, and added the previously built
> lib
> in the solution and references.
> I added the path of source files in my HelloWorld ITK project to additional
> include directories of this project.
>
> But as soon as I tried to include any header files of the ITK lib project
> into the source files of this project, I started getting errors telling me
> the various ITK Headers it could not find.
>
> What I am really trying is this :
> I have a function, that performs deconvolution in ITK. It takes two vectors
> as inputs and returns a vector as output. I added this function to a header
> file. It works as an executable and builds to a lib, but since I need to
> use
> the code in another project, I am facing the problems I mentioned above.
>
> Can you please point me in the direction, as how can I import a ITK
> function
> into my existing Visual Studio project?
>
That explains it. You can't just setup a Visual Studio project manually -
you need to create the Visual Studio project using CMake. When you run
CMake, it gives you the option of which "generator" you want to use. This
setups up all the ITK paths for you, so you won't experience problems like
you are seeing.
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120610/6ed8e95b/attachment.htm>
More information about the Insight-users
mailing list