[ITK] [ITK-users] Problem adding ITK to project
Matt McCormick
matt.mccormick at kitware.com
Thu Apr 23 16:37:38 EDT 2015
Hi Kent,
These patches [1][2] will help address VTK shared builds with VTK
6.2.0 and VTK master. They are available in current ITK master and
will be added to the upcoming 4.7.2 release. There were additional
issues related to your original question that were addressed in the
VTK 6.2.0 release.
HTH,
Matt
[1] http://review.source.kitware.com/#/c/19667/
[1] http://review.source.kitware.com/#/c/19673/
On Thu, Apr 23, 2015 at 10:42 AM, Kent Ogden <ogdenk at upstate.edu> wrote:
> It took me a while to get back to this issue, but I was able to test my
> theory that the problem was related to not building VTK with shared
> libraries.
>
> Short story, my hypothesis was incorrect, rebuilding VTK with Shared
> Libraries turned on (and rebuilding ITK) did not solve the problem. I think
> I was using VTK 6.0.0. I just upgraded to the latest version and built VTK
> with static libraries, rebuilt ITK, and the problem went away. So, I'm not
> sure if it was a problem with the version of VTK I was using, something set
> incorrectly in my VTK build, or something else.
>
> Thanks for the responses to this issue . . .
>
> Kent
>
>
>
>>>> Matt McCormick <matt.mccormick at kitware.com> 4/9/2015 5:31 PM >>>
>
> Hi Kent,
>
> Thanks for discussing this on the list. A restriction on static
> libraries is not a known issue -- it would be interesting to get your
> report on whether shared libraries help.
>
> What version of ITK and VTK is this?
>
> Thanks,
> Matt
>
> On Thu, Apr 9, 2015 at 3:19 PM, Kent Ogden <ogdenk at upstate.edu> wrote:
>> I think I realized what the problem is. I don't have time to verify this
>> now but I will report back when I do.
>>
>> When I did this last (about a year ago) I was using a VTK build that was
>> set
>> to create shared libraries. As I recall that was required when I built
>> ITK
>> with ITKVTKGlue turned on. My current build is using static VTK libraries
>> (nice not to have to deal with .dll's) and I didn't get the error in CMake
>> when setting up ITK, and the Quickviewer worked just fine. I suspect that
>> my problem now is that I don't have VTK built with shared libraries. Does
>> this make sense to anyone?
>>
>> Kent
>>
>>
>>>>> Pol Monsó Purtí 04/09/15 1:48 PM >>>
>>
>> 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
>>>
>>
>>
>> _____________________________________
>> 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
>>
_____________________________________
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