[ITK] [ITK-users] Problem adding ITK to project

Pol Monsó Purtí lluna.nova at gmail.com
Thu Apr 9 13:47:51 EDT 2015


Hello Kent,

vtkRenderingCore_INCLUDE is probably empty so it then results on #include
and that's it.

Maybe try adding #warning vtkRenderingCore_INCLUDE to see it's contents,
but that's probably what's happening.

2015-04-09 18:42 GMT+02:00 Kent Ogden <ogdenk at upstate.edu>:

>  Hi,
>
> I am trying to do something really simple, I have a VTK project (I'm
> trying this with the cone.cxx example, about as simple as it gets) and I
> want to add ITK functionality.  In the past I had used a modified version
> of the ITKQuickView example, and it used to work:
>
> cmake_minimum_required(VERSION 2.8)
>
> project(Cone)
>
> find_package(ITK REQUIRED)
> include(${ITK_USE_FILE})
> if (ITKVtkGlue_LOADED)
>   find_package(VTK REQUIRED)
>   include(${VTK_USE_FILE})
> else()
>   find_package(ItkVtkGlue REQUIRED)
>   include(${ItkVtkGlue_USE_FILE})
>   set(Glue ItkVtkGlue)
> endif()
>
> add_executable(Cone MACOSX_BUNDLE Cone.cxx)
> target_link_libraries(Cone
>   ${Glue}  ${VTK_LIBRARIES} ${ITK_LIBRARIES})
>
> Now, however, I get the following compile error (VS 2012 64 bit on Win 7):
>
> 2>C:\KW\VTKBuild\Rendering\Core\vtkRenderingCoreModule.h(37): error C2006:
> '#include' : expected a filename, found 'newline'
> The vicinity of that line in vtkRenderingCoreModule.h is
>
> /* AutoInit implementations.  */
> #if defined(vtkRenderingCore_INCLUDE)
> # include vtkRenderingCore_INCLUDE  // Error is from this line
> #endif
> #if defined(vtkRenderingCore_AUTOINIT)
> # include "vtkAutoInit.h"
> VTK_AUTOINIT(vtkRenderingCore)
> #endif
>
> I do not have any ITK functionality added to the program yet, it is just
> the cone.cxx example.  If I use a very simple CMakelists.txt file the
> program compiles and runs just fine:
>
> cmake_minimum_required(VERSION 2.8)
>
> project(Cone)
> set(VTK_DIR "C:/KW/VTKBuild")
> set(ITK_DIR "C:/KW/ITKBuild")
>
> find_package(VTK REQUIRED)
> include(${VTK_USE_FILE})
>
> add_executable(Cone MACOSX_BUNDLE Cone.cxx)
> target_link_libraries(Cone ${VTK_LIBRARIES} )
>
> But if I try to add
>
> find_package(ITK REQUIRED)
> include(${ITK_USE_FILE})
>
> I get the same error as above.  I am sure this is a simple issue but my
> understanding of CMake is limited.  I know this isn't precisely an ITK
> problem per se but I hoped someone could point out what I am doing wrong.
>
> Any help greatly appreciated!
>
> Kent
>
>
>
>
>
>
>
>
>
> Kent Ogden PhD
> Associate Professor, Radiology
> SUNY Upstate Medical University
> 750 E. Adams Street
> Syracuse, NY  13210
>
> email:  ogdenk at upstate.edu
> voice:  (315) 464-5083
> fax:       (315) 464-8789
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> 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://public.kitware.com/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20150409/e3db79aa/attachment.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

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://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list