[vtkusers] How to compile tutorial example?

James Frye frye at cs.unr.edu
Thu Feb 9 17:36:41 EST 2006


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 $< 






More information about the vtkusers mailing list