[vtkusers] Migration problem vtk 5.8 - vtk 6.1
Lorenzo Cesario
lorenzo.cesario at softeco.it
Tue Jul 1 09:39:24 EDT 2014
Hi John, tks for your answer.
Yes I used the same compiler (VS2010) and I compiled vtk libraries as dlls.
Of course I included debug compiled vtk dlls in my application (debug mode)
and release compiled vtk dlls in my release application.
It seems like it has problem to cleaning up the
vtkInteractionStyleObjectFactory during the method
"UnregisterAllFactories()" of the class "vtkCleanupObjectFactory".
Why it has this problem with the vtkInteractionStyle module?
Any ideas?
Tks,
Lorenzo
----- Original Message -----
From: "John Drescher" <drescherjm at gmail.com>
To: <lorenzo.cesario at softeco.it>
Cc: <vtkusers at vtk.org>
Sent: Tuesday, July 01, 2014 3:16 PM
Subject: Re: [vtkusers] Migration problem vtk 5.8 - vtk 6.1
> 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