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

Cory Quammen cquammen at cs.unc.edu
Mon Nov 12 16:19:54 EST 2012


Kyle,

Adding the line

include(${VTK_USE_FILE})

as David suggested fixed this problem in the past for me.

Cory

On Mon, Nov 12, 2012 at 4:16 PM, David Doria <daviddoria at gmail.com> wrote:
> 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
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>



-- 
Cory Quammen
Research Associate
Department of Computer Science
The University of North Carolina at Chapel Hill



More information about the vtk-developers mailing list