Compiling without CMake

I am new to vtk. I’d like to explore the possibility about creating some bindings for VTK. As a first step, I need to know how to compile a basic example but without using CMake.

Up to know, I tried:

  1. Just by exploring the missing symbols:
g++ -std=c++11 -I/usr/include/vtk -lvtkCommonCore -lvtkCommonColor -lvtkFiltersSources -lvtkInteractionStyle -lvtkRenderingContextOpenGL2 -lvtkRenderingCore -lvtkRenderingFreeType -lvtkRenderingGL2PSOpenGL2 -lvtkRenderingOpenGL2 -lvtksys  -lvtkCommonExecutionModel ex01_cylinder.cpp -o ex01_cylinder
  1. By exploring link.txt created with cmake:
g++ -std=c++11 -I/usr/include/vtk -lvtkInteractionStyle -lvtkRenderingContextOpenGL2 -lvtkRenderingGL2PSOpenGL2 -lvtkRenderingOpenGL2 -lvtkRenderingContext2D -lvtkRenderingFreeType -lfreetype -lvtkRenderingHyperTreeGrid -lvtkRenderingUI -lvtkRenderingCore -lvtkCommonColor -lvtkFiltersSources -lvtkFiltersGeneral -lvtkFiltersCore -lvtkCommonExecutionModel -lGLEW -lX11 -lvtkCommonDataModel -lvtkCommonTransforms -lvtkCommonMisc -lvtkCommonMath -lvtkCommonCore -lvtksys -ldl -ltbb -lgomp -Wl,-Bstatic -lpthread -Wl,-Bdynamic -lvtkkissfft ex01_cylinder.cpp -o ex01_cylinder

Both examples aboce create the executable, but for some reason it is not interactive. When I compile the same code (which the Hello World cylinder) I am able to interact with the cylinder.

Any clue about what I am missing in the compilation line?

Object factory initialization. You need to link to rendering and interaction implementations and pass a -D (or embed it into the source) to have the factories initialized. See the docs here and for the vtk_module_autoinit function.

Really, it’s just going to be easier to use CMake, even if you end up with something like paraview-config.

Thanks for the reply and sorry for coming back to you so late (I’ve been off for a couple of weeks). Just to thank you. It was spot on.

Sadly, in my case I need to avoid cmake. I need to think about how to do it.