[vtkusers] Newbie VTK/C++ question

Jeff Lee jeff at cdnorthamerica.com
Wed Jun 2 09:53:11 EDT 2004


need to compile shared to get java support.  try that and see what 
happens...
-J

kitware-vtk at kulnet.kuleuven.ac.be wrote:

> ---  Forwarded by news2mail for Bach <invalid at kuleuven.ac.be> ---
>
> I'm new to VTK and rather new to C++. I want to use VTK for some 
> visualisations in a CFD application. I'm using VTK 4.2
>
> I was able to get things working using precompiled VTK binaries and 
> Java, but so far all my attempts on getting it working with C++ have 
> failed.
> I tried on Windows (Visual Studio .Net) and on Debian GNU/Linux Woody 
> (kernel 2.4.25 - g++ 2.95.4 20011002).
>
>
>
> Below I'll describe what I've done (on Linux).  Please correct me in 
> the likely case I did anything stupid.
>
> 1 - Compilation of VTK
>
> I compiled VTK using CMake (as instructed in the readme: cmake -i, 
> make ...).
> The result of this, is a set of binaries in the $VTK/bin directory.
> I copied all header (.h) files and library (.a) files to respectively 
> $VTK/include and $VTK/lib.
> I don't know wheter this is important but in cmake I've choosen static 
> linking.
>
>
> 2 - Compilation of application
>
> I use one of the examples to test my VTK setup.  I compile it using
>     g++ -c -I/tmp/VTK/include Cone.cxx
> This completes succesfully.  However when I try to link it using
>     g++ -o Cone -I/tmp/VTK/include -L/tmp/VTK/lib -lGL -lGLU 
> -lvtkCommon -lvtkIO -lvtkGraphics -lvtkRendering -lvtkFiltering Cone.o
> I get the following error:
>     Cone.o: In function `main':
>     Cone.o(.text+0x8): undefined reference to `vtkConeSource::New(void)'
>     Cone.o(.text+0x70): undefined reference to 
> `vtkPolyDataMapper::New(void)'
>     Cone.o(.text+0x84): undefined reference to 
> `vtkPolyDataSource::GetOutput(void)'
>     Cone.o(.text+0x93): undefined reference to 
> `vtkPolyDataMapper::SetInput(vtkPolyData *)'
>     Cone.o(.text+0x9b): undefined reference to `vtkActor::New(void)'
>     Cone.o(.text+0xc2): undefined reference to `vtkRenderer::New(void)'
>     Cone.o(.text+0xd7): undefined reference to 
> `vtkRenderer::AddActor(vtkProp *)'
>     Cone.o(.text+0x117): undefined reference to 
> `vtkRenderWindow::New(void)'
>     Cone.o(.text+0x19b): undefined reference to 
> `vtkRenderer::GetActiveCamera(void)'
>     Cone.o(.text+0x1a6): undefined reference to 
> `vtkCamera::Azimuth(double)'
>     collect2: ld returned 1 exit status
>
>
> Thanks in advance
> _______________________________________________
> This is the private VTK discussion list. Please keep messages 
> on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>




More information about the vtkusers mailing list