[vtk-developers] NULL always returned from vtkPolyDataMapper::New()

David Doria daviddoria at gmail.com
Mon Nov 12 16:16:09 EST 2012


On Mon, Nov 12, 2012 at 4:09 PM, Kyle Lutz <kyle.lutz at kitware.com> wrote:
>
> Hello everyone,
>
> I'm trying to write a small reproducible test case for a bug I'm
> working on but I can't even get a simple visualization pipeline
> running. When I try to create a vtkPolyDataMapper I always get NULL
> returned. I've looked through the wiki and at the VTK6 migration guide
> but can't find anything related to what I'm seeing.
>
> I'm sure I'm doing something wrong but I can't seem to figure out:
>
> === main.cpp ===
> #include <cassert>
> #include <vtkPolyDataMapper.h>
>
> int main()
> {
>   vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();
>   assert(mapper != 0);
>   return 0;
> }
>
> === CMakeLists.txt ===
> find_package(VTK REQUIRED)
> include_directories(${VTK_INCLUDE_DIRS})
>
> add_executable(test main.cpp)
> target_link_libraries(test vtkRenderingCore)
>
> Platform: Ubuntu Linux, 64-bit, GCC 4.6.3, VTK from gerrit/master (as
> of this morning)
>
> I've also tried changing the link line to ${VTK_LIBRARIES} (which
> gives the same assertion error) and vtkHybrid (which gives a
> "-lvtkHybrid" not found error when linking).
>
> Any help would be greatly appreciated.
>
> Thanks,
> Kyle


I don't know if this would cause the problem, but a line I always use
and that is absent in your CMakeLists.txt is:

include(${VTK_USE_FILE})

David



More information about the vtk-developers mailing list