[vtkusers] Auto init and not using CMake

Totte Karlsson totte at dunescientific.com
Fri Feb 6 17:10:21 EST 2015


Hello,
I am having some success and some issues with getting vtk (6.1) working 
in a Borland VCL application. For such, I'm not using Cmake. However, 
I'm using CMake for building vtk core libs.

The problems are that I do get the 'no override found for vtkRenderer' 
errors. These problems seem to be associated with 'Implementation 
Modules' (that's above my head), but info is given at the vtk Wiki: 
http://www.vtk.org/Wiki/VTK/Build_System_Migration

Despite that information, I do still have some issues.

Some observations;
1) When building a DLL (libA) that are linked to core vtk DLL libraries, 
placing the following

#include <vtkAutoInit.h>
VTK_MODULE_INIT(vtkRenderingOpenGL);
VTK_MODULE_INIT(vtkInteractionStyle);
VTK_MODULE_INIT(vtkRenderingFreeType);

in a source file when building the library (libA) seem to create a 
library where apps linking to the library (libA) do not need any extra 
"init stuff". I see this working fine with simple console apps.

2) If the above code is left out when building the library (libA), then 
placing it in a source file of the application build seem to 'Init' vtk. 
Where it is placed seem not to make a difference.
To make libA easy to use for clients, it seem the above code is 
preferably placed in a source file of the libA build.

Question 1: Is there a correct place on where to place the init code for 
the above scenario? In a source file in the build of libA, or in the 
source of each app using libA? The info page about the init code don't 
handle this situation. It only talks about creating an app linking 
directly to the core vtk libs.

3) When building a win32 applications using borlands VCL, on the other 
hand, the init code seem to behave differently. No matter what, when 
creating any application using a package, that is using vtk, the 
'autoinit' code always seem to have to be present in the (application) 
build. Perhaps this is a feature/consequence of using VCL packages.

Question 2, is there a flag or something that one can use when building 
the core vtk libraries that would take care of the auto_init stuff for 
any clients of the libraries? Its not a big deal of course, but just 
this one extra complication.

tk

-- 
.........................
Totte Karlsson, Ph.D.
Dune Scientific, LLC
425-296 1980 (office)
425-780 9648 (cell)
www.dunescientific.com
.........................



More information about the vtkusers mailing list