[vtkusers] Error Compiling Sample Code

Dominik Szczerba domi at vision.ee.ethz.ch
Tue May 22 16:56:30 EDT 2007


Alternatively and more generally (under linux) use something like "nm -A 
| grep the_missing_symbol" in the libs directory (RTFM on nm)
- Dominik

Kevin H. Hobbs wrote:
> On Tue, 2007-05-22 at 14:08 -0400, Ashivni Shekhawat wrote:
>> Hi!
>>     I am new to vtk and to graphics and rendering.
>> I have installed vkt 5.0.3. When I try to compile the example code for
>> creating a sphere http://vtk.org/example-code.php I get the errors
>> appended. While it is apparent that I am not linking to the required
>> libraries, I could not find information on which libraries to link to
>> and how. Any suggestions?
>>
>> Thanks in advance
>> -Ashivni.
>>
> 
> I usually just use locate. This works because usually the name of the
> directory in which a VTK file is found is the name of the library that
> holds it as well.
> 
>> try.cpp:(.text+0x84): undefined reference to `vtkSphereSource::New()'
> 
> locate tells me that vtkSphereSource.h is in the VTK/Graphics/ directory
> so I add vtkGraphics to my TARGET_LINK_LIBRARIES in my CMakeLists.txt. I
> think you can just -lvtkGraphics as well. 
> 
>> try.cpp:(.text+0xde): undefined reference to `vtkPolyDataMapper::New()'
> 
> vtkPolyDataMapper.h is in VTK/Rendering/ so I link against vtkRendering.
> I always link against vtkCommon.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

-- 
Dominik Szczerba, PhD
Computer Vision Lab CH-8092 Zurich
http://www.vision.ee.ethz.ch/~domi



More information about the vtkusers mailing list