[vtkusers] Difficulties migrating from vtk5.10.1 to vtk6.1.0 (MSVC++)

Marcus D. Hanwell marcus.hanwell at kitware.com
Tue Apr 8 13:46:10 EDT 2014


On Sun, Apr 6, 2014 at 2:48 PM, pof <jd379252 at gmail.com> wrote:
> Hi all,
>
> I am (desperately)  trying to migrate my application from 5.10.1 to 6.1.0,
> and so far without any success.
> I guess the problem comes from the fact that my application is compiled and
> linked with MSVisualStudio, without any use of CMake (though I obviously use
> CMake used to compile vtk librairies).
>
> Typically, I tried to follow what is mentionned on the wiki, i.e. adding the
> following 2 lines at the beginning of header files that #include vtk
> objects:
> #define vtkRenderingCore_AUTOINIT
> 4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)
> #define vtkRenderingVolume_AUTOINIT 1(vtkRenderingVolumeOpenGL)

I would advise you to use the new macros I added as they just need to
be called one from your application (not defined before any header is
included). See,

http://www.vtk.org/Wiki/VTK/Build_System_Migration#How_Implementation_Modules_Are_Initialized

#include <vtkAutoInit.h>

 VTK_MODULE_INIT(vtkRenderingOpenGL);
 VTK_MODULE_INIT(vtkInteractionStyle);

That would initialize the vtkRenderingOpenGL and vtkInteractionStyle
modules and you would not need to add compiler definitions on the
command line or by hand.
>
> But this does not work. I also try to add paths for include files, without
> success. For instance, compiling a simple file, the compiler complains with:
> fatal error C1083: Impossible to open include file :
> 'vtkRenderWindowInteractor.h : No such file or directory

If you build against an installed VTK then all of the includes will be
installed to one directory, and then you just need to ensure you add
that to the include search path. If you choose to build against the
build tree then you must add every source and binary directory for
every module you use and/or depend up on.
>
> So I'm completely lost. Is there any available example (using MSVC++) of a
> simple project successfuly migrated in vtk6.
>
I am not sure of any examples, but the above should make this pretty
simple. Hopefully this helps.

Marcus


More information about the vtkusers mailing list