[vtkusers] Compiling the scatterplot example without cmake

Zoltan Takacs zozonmr at gmail.com
Sun Apr 1 18:16:15 EDT 2018


Hi,

I have general question about how to compile code without using cmake. I 
have downloaded the scatterplot example because I wanted start from 
something simple. The cmake type of compilation works and the executable 
provides the plot. However when I try to compile it without cmake I get 
a segmentation fault error. This is how I modified the include list:

#include <vtkVersion.h>
#include <vtkSmartPointer.h>
#include <vtkChartXY.h>
#include <vtkContextScene.h>
#include <vtkContextView.h>
#include <vtkFloatArray.h>
#include <vtkPlotPoints.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>
#include <vtkTable.h>

I added the following lines:

#include <vtkAutoInit.h>

VTK_MODULE_INIT(vtkRenderingOpenGL);
VTK_MODULE_INIT(vtkRenderingContextOpenGL);
VTK_MODULE_INIT(vtkRenderingVolumeOpenGL);
VTK_MODULE_INIT(vtkInteractionStyle);

The code compiles like this and the compiler does not complain however 
when I run it then it quits with segmentation fault. My guess (and only 
a guess) that this line causes the trouble:

view->GetInteractor()->Start();

Why is the seg. fault happening?

Thanks




More information about the vtkusers mailing list