[vtkusers] Migration problem vtk 5.8 - vtk 6.1

John Drescher drescherjm at gmail.com
Tue Jul 1 09:16:17 EDT 2014


On Tue, Jul 1, 2014 at 4:52 AM,  <lorenzo.cesario at softeco.it> wrote:
> Hi,
> my application has an executable and some dlls. Among them, there is one dll that used vtk 5.8 and now I'm doing the migration to the vtk 6.1.
>  I'm using Visual Studio 2010 and my appliation is MFC-based.
>
> In the properties of the dll using vtk, I obviously included the "Additional Include Directories" and "Additional Library" for the vtk header files and .lib files.
> Moreover I added in the "Preprocessor definition" field of the C/C++ Property of the same dll, this value: vtkRenderingCore_INCLUDE="InitVtkObjFactory.h" and I added the file InitVtkObjFactory.h with this code:
>
> #include <vtkAutoInit.h>
> VTK_MODULE_INIT(vtkRenderingOpenGL);
> VTK_MODULE_INIT(vtkInteractionStyle);
> VTK_MODULE_INIT(vtkRenderingFreeType);
> VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL);
>
> When I close the application it crashes and in the call stack there is the last call on vtkCommonCore-6.1.dll.
>
> Then, I removed the line inside the file InitVtkObjFactory.h related to the InteractionStyle as follows:
>
> #include <vtkAutoInit.h>
> VTK_MODULE_INIT(vtkRenderingOpenGL);
> VTK_MODULE_INIT(vtkRenderingFreeType);
> VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL);
>
> and in this case, when the application starts, it shows a "warning" window from vtk in which is written:
>
> Warning: In ..\..\..\..\..\src\Vtk\Rendering\Core\vtkInteractorStyleSwitchBase.cxx, line 43
> vtkInteractorStyleSwitchBase (07EC7FB8): Warning: Link to vtkInteractionStyle for default style selection.
>
> but when I close the application, this time it has no error or crashes. I'm using a vtkInteractorStyleTrackballCamera for my RenderWindow.
>
> Any ideas? Is there anything wrong in the migration related to the new modules initialization?
>

I see you are using vtk dlls. Were they built from the same compiler
as you use and the same configuration. You can't safely mix compilers
or use Releaase dlls in a debug application or debug dlls in a release
application.

John


More information about the vtkusers mailing list