[vtkusers] vtk6 porting question (segfault)
Bill Lorensen
bill.lorensen at gmail.com
Tue Aug 14 12:51:01 EDT 2012
Have you tried building your example with CMake. I suspect you are missing
some libraries.
On Tue, Aug 14, 2012 at 11:47 AM, Trevor Irons <trevorirons at gmail.com>wrote:
> Sorry if this has been asked before, but I couldn't find it.
>
> I am having trouble porting an application over to VTK 6.0. I followed the
> guide at
> http://www.vtk.org/Wiki/VTK/VTK_6_Migration_Guide
>
> 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
>
> // First include the required header files for the VTK classes we are
> using.
> #include "vtkConeSource.h"
> #include "vtkPolyDataMapper.h"
>
> int main()
> {
>
> vtkConeSource *cone = vtkConeSource::New();
> cone->SetHeight( 3.0 );
> cone->SetRadius( 1.0 );
> cone->SetResolution( 10 );
>
> vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
> coneMapper->SetInputConnection( cone->GetOutputPort() );
> //coneMapper->SetInputData( cone->GetOutput() );
> // I tried this too
>
> exit(0);
>
> }
>
> I have been compiling with
>
> g++ Cone.cxx -g -g3 -o testit -I/usr/local/include/vtk-6.0/
> -lvtkRenderingCore-6.0 -lvtkFiltersSources-6.0
> -lvtkCommonExecutionModel-6.0
>
> on
>
> g++ --version
> g++ (GCC) 4.7.1 20120721 (prerelease)
> Copyright (C) 2012 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> And when I execute, I just see a segmentation fault. I assume I am doing
> something wrong, but I can't figure out what.
>
> 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.
>
> Thanks for any suggestions.
>
> -- Trevor
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
--
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120814/3a6c5c91/attachment.htm>
More information about the vtkusers
mailing list