[vtkusers] How to compile tutorial example?

David Cole david.cole at kitware.com
Fri Feb 10 09:01:54 EST 2006


If you successfully compiled and installed VTK 5.0, you must have used 
CMake to do so...

Use CMake to generate a makefile for you... If you point CMake at 
Examples/Tutorial/Step1/Cxx as the source directory you should be able 
to get a makefile that will build step 1 linking to the VTK you just built.

HTH,
David

James Frye wrote:

>Hi,
>
>I've just downloaded and installed VTK 5.0.  I compiled and installed it
>in /opt/vtk.  Now I'm trying to get the first example in
>Examples/Tutorial/Step1 to run.  
>
>Since there is no Makefile, I made a simple one, which I've included at
>the end.  The problem is that this gives me about 54K lines of "undefined
>reference to vtkSomething..." messages.  Obviously. something fundamental
>is wrong, but what?  How do I get a Makefile that I can use to compile a
>simple example?
>
>Thanks,
>James
>
>PS: I did read the install instructions, all the FAQs, and tried to search
>the mailing list archives (using "how to compile example" as a search
>string).
>
>
>The Makefile:
>
>NAME = Cone
>
>CC   = /usr/bin/gcc
>CPP  = /usr/bin/gcc
>
>CFLAGS += -g -Wunused -Wno-deprecated -I/opt/vtk/include/vtk-5.0
>LIBS = -L/opt/vtk/lib \
>       -lvtkCommon -lvtkDICOMParser -lvtkFiltering -lvtkGenericFiltering \
>       -lvtkGraphics -lvtkHybrid -lvtkIO -lvtkImaging -lvtkMPEG2Encode \
>       -lvtkNetCDF -lvtkRendering -lvtkVolumeRendering -lvtkWidgets    \
>       -lvtkexoIIc -lvtkexpat -lvtkfreetype -lvtkftgl -lvtkjpeg -lvtkpng \
>       -lvtksys -lvtktiff -lvtkzlib
>
>
>$Cone: Cone.o
>	$(CC) -o $@ $^ $(LIBS)
>
>
>.cpp.o:
>	  $(CPP) $(CFLAGS) -c $< 
>
>
>
>_______________________________________________
>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
>
>  
>



More information about the vtkusers mailing list