Sorry if this has been asked before, but I couldn't find it. <br><br>I am having trouble porting an application over to VTK 6.0. I followed the guide at <br><a href="http://www.vtk.org/Wiki/VTK/VTK_6_Migration_Guide" target="_blank">http://www.vtk.org/Wiki/VTK/VTK_6_Migration_Guide</a><br clear="all">
<br>I am able to get my project to compile but I hit a seg fault at execution. As a minimal example consider a pared down Cone.cxx from the Examples <br><br>// First include the required header files for the VTK classes we are using.<br>
#include "vtkConeSource.h"<br>#include "vtkPolyDataMapper.h"<br><br>int main()<br>{<br><br> vtkConeSource *cone = vtkConeSource::New();<br> cone->SetHeight( 3.0 );<br> cone->SetRadius( 1.0 );<br>
cone->SetResolution( 10 );<br><br> vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();<br> coneMapper->SetInputConnection( cone->GetOutputPort() );<br> //coneMapper->SetInputData( cone->GetOutput() ); // I tried this too<br>
<br> exit(0);<br><br>} <br><br>I have been compiling with <br><br>g++ Cone.cxx -g -g3 -o testit -I/usr/local/include/vtk-6.0/ -lvtkRenderingCore-6.0 -lvtkFiltersSources-6.0 -lvtkCommonExecutionModel-6.0 <br><br>on <br>
<br>g++ --version<br>g++ (GCC) 4.7.1 20120721 (prerelease)<br>Copyright (C) 2012 Free Software Foundation, Inc.<br>This is free software; see the source for copying conditions. There is NO<br>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br>
<br>And when I execute, I just see a segmentation fault. I assume I am doing something wrong, but I can't figure out what. <br><br>I ran it through gdb, but it just said the fault was in SetInputConnection, or SetInputData, I tried both. This is with the tip of VTK from the git repository.<br>
<br>Thanks for any suggestions. <br><br>-- Trevor<br><br>