[vtkusers] HELP! VTK & LINUX

Clinton Stimpson clinton at elemtech.com
Wed Jul 2 08:29:04 EDT 2003


Christos Panagiotou,

The problem that you see on gcc's bulliten board is due to the attempt of 
combining objects build with two incompatible compilers.  For example, gcc 
2.95 and gcc 3.2 produce code that is incompatible with the other and that 
could also explain your linking problem.

1.  However, I'd first check to make sure you really are linking 
    with the VTK libraries.
    I couldn't quite tell from the text below.  I'd expect something similar
    "-L/usr/lib/vtk -lRendering -lvtkGraphics -lvtkCommon" that has all the 
libraries you need.

2.  Check your compiler version to make sure it is compatible with VTK's 
rpms.  As I understand, gcc 3.2 and 3.3 are compatible.

Clint

> --__--__--
> 
> Message: 9
> Date: Wed, 02 Jul 2003 06:24:26 +0100
> From: Christos Panagiotou <cpanagio at cs.ucl.ac.uk>
> To: vtkusers at vtk.org
> Subject: [vtkusers] HELP! VTK & LINUX
> 
> guys is there any problem with vtk linking in linux?
> 
> I installed the rpm nightly release as I thought i did something wrong 
> in the compilation of the src files (which I had the same problem that I
> 
> have with the rpm build). All headers were placed in /usr/include/vtk. I
> 
> linked the complier (I use KDevelop) to include this directory (-I 
> /usr/include/vtk) and I STILL have errors about _undefined methods._
> I try to compile and run the sphere example shown in 
> http://www.vtk.org/example-code.php (which is supposed to show 
> functionality of VTK and I assume its tested) however I get all these 
> errors:
> 
> /bin/sh ../libtool --silent --mode=link --tag=CXX g++ -Wnon-virtual-dtor
> 
> -Wno-long-long -Wundef -Wall -pedantic -W -Wpointer-arith 
> -Wmissing-prototypes -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 
> -D_BSD_SOURCE -Wcast-align -Wconversion -O2 -O0 -g3 -Wall -I 
> /usr/include/vtk -fno-exceptions -fno-check-new -o asm_3d main.o 
> ./Globals/Functions/libFunctions.a
> 
> 
> main.o(.text+0x11): In function `main':
> /home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:43: undefined 
> reference to `vtkPolyData::New()'
> main.o
(.text+0x19):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:44:
> 
> undefined reference to `vtkPoints::New()'
> main.o
(.text+0x21):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:45:
> 
> undefined reference to `vtkCellArray::New()'
> main.o
(.text+0x29):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:46:
> 
> undefined reference to `vtkFloatArray::New()'
> main.o
(.text+0xbe):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:51:
> 
> undefined reference to `vtkDataArray::InsertTuple1(int, float)'
> main.o
(.text+0x105):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:56:
> 
> undefined reference to `vtkPolyData::SetPolys(vtkCellArray*)'
> main.o
(.text+0x134):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:58:
> 
> undefined reference to `vtkDataSetAttributes::SetScalars(vtkDataArray*)'
> main.o
(.text+0x151):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:62:
> 
> undefined reference to `vtkPolyDataMapper::New()'
> main.o
(.text+0x162):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:63:
> 
> undefined reference to `vtkPolyDataMapper::SetInput(vtkPolyData*)'
> main.o
(.text+0x188):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:65:
> 
> undefined reference to `vtkActor::New()'
> main.o
(.text+0x1aa):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:69:
> 
> undefined reference to `vtkCamera::New()'
> main.o
(.text+0x1cd):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:70:
> 
> undefined reference to `vtkCamera::SetPosition(double, double, double)'
> main.o
(.text+0x1e7):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:71:
> 
> undefined reference to `vtkCamera::SetFocalPoint(double, double,
> double)'
> main.o
(.text+0x1ef):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:73:
> 
> undefined reference to `vtkRenderer::New()'
> main.o
(.text+0x1f7):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:74:
> 
> undefined reference to `vtkRenderWindow::New()'
> main.o
(.text+0x219):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:77:
> 
> undefined reference to `vtkRenderWindowInteractor::New()'
> main.o
(.text+0x22a):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:78:
> 
> undefined reference to 
> `vtkRenderWindowInteractor::SetRenderWindow(vtkRenderWindow*)'
> main.o
(.text+0x24c):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:81:
> 
> undefined reference to `vtkRenderer::SetActiveCamera(vtkCamera*)'
> main.o
(.text+0x25a):/home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:82:
> 
> undefined reference to `vtkRenderer::ResetCamera()'
> main.o(.gnu.linkonce.t._ZN11vtkRenderer8AddActorEP7vtkProp+0x10): In 
> function `vtkRenderer::AddActor(vtkProp*)':
> /home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:43: undefined 
> reference to `vtkViewport::AddProp(vtkProp*)'
> main.o(.gnu.linkonce.t._ZN14vtkIdTypeArray12WritePointerEii+0x24): In 
> function `vtkIdTypeArray::WritePointer(int, int)':
> /home/christos/VIVE02/project/asm_3d/asm_3d/main.cpp:45: undefined 
> reference to `vtkIdTypeArray::ResizeAndExtend(int)'
> collect2: ld returned 1 exit status
> gmake[3]: *** [asm_3d] Error 1
> gmake[3]: Leaving directory
> `/home/christos/VIVE02/project/asm_3d/asm_3d'
> gmake[2]: *** [all-recursive] Error 1
> gmake[2]: Leaving directory
> `/home/christos/VIVE02/project/asm_3d/asm_3d'
> gmake[1]: *** [all-recursive] Error 1
> gmake[1]: Leaving directory `/home/christos/VIVE02/project/asm_3d'
> gmake: *** [all] Error 2
> *** failed ***
> 
> 
> I saw also this msg posted in a bulleting board:
> 
> 
>   GCC "Name Mangling" Prevent from Linking?
> 
> (http://gcc.gnu.org/ml/gcc-help/2002-04/msg00124.html)
> 
> Please anyone know something about this please email me
> 
> I would be greatfull for any replies
> cheers
> christos
> 




More information about the vtkusers mailing list