[vtkusers] linking problems

Clinton Stimpson clinton at elemtech.com
Mon Jul 12 09:45:30 EDT 2004


You need to give the compiler the libraries to link with.  You only told 
it where the libraries are to link with.

It'll be something like this.

g++ -I/usr/include/vtk -L/usr/lib/vtk  -lvtkIO -lvtkRendering -lvtkftgl \
           -lvtkfreetype -lvtkImaging -lvtkGraphics -lvtkFiltering -lvtkCommon\
            -lvtkexpat -lvtkjpeg -lvtkpng -lvtktiff -lvtkzlib Medical1.cxx


Clint

>------------------------------
>
>Message: 7
>Date: Mon, 12 Jul 2004 13:21:43 +0200
>From: Torsten Wirz <wirz at ifht.rwth-aachen.de>
>Subject: [vtkusers] linking problems
>To: vtkusers at vtk.org
>Message-ID: <200407121321.43484.wirz at ifht.rwth-aachen.de>
>Content-Type: text/plain;  charset="utf-8"
>
>hi all, 
>
>I´m a newbie user of the VTK library and have problems by linking the  
>Medical1.cxx test programm with the g++ compiler. 
>
>g++ -I/usr/include/vtk -L/usr/lib/vtk  Medical1.cxx
>
>The compilation is no problem, but when he starts linking the following errors 
>occure:
>
>/tmp/cc0mHzj4.o(.text+0x6c): In function `main':
>: undefined reference to `vtkRenderer::New()'
>------- snip -----------
>
>these message for each vtk-memberfunktion.
>
>I´m using Suse Linux 8.1 and the dynamic libraries are available:
>
>gdpc27:/home/wirz #  ldconfig -p | grep vtk
>        libvtkzlib.so (libc6) => /usr/lib/vtk/libvtkzlib.so
>        libvtktiff.so (libc6) => /usr/lib/vtk/libvtktiff.so
>        libvtkpng.so (libc6) => /usr/lib/vtk/libvtkpng.so
>        libvtkjpeg.so (libc6) => /usr/lib/vtk/libvtkjpeg.so
>        libvtkftgl.so (libc6) => /usr/lib/vtk/libvtkftgl.so
>        libvtkfreetype.so (libc6) => /usr/lib/vtk/libvtkfreetype.so
>        libvtkexpat.so (libc6) => /usr/lib/vtk/libvtkexpat.so
>------- snip ------------
>
>I don´t now why the linker can not find libraries. Does anybody have an idea?
>
>thanx all in advance 
>
>best regards
>
>Torsten
>  
>




More information about the vtkusers mailing list