[vtkusers] Link to VTK library

L.Ding at surrey.ac.uk L.Ding at surrey.ac.uk
Mon Mar 26 07:26:52 EDT 2012


Dear VTK community


I am having a problem liking the VTK library to my code.

I attached my Makefile in the end. But when I type make command, I always got following error messages.

/mnt/home/yazaydin/VTKjob/MFI-nC6/YZ/main.c:650: undefined reference to `vtkPolyDataAlgorithm::SetInput(vtkDataObject*)'
/mnt/home/yazaydin/VTKjob/MFI-nC6/YZ/main.c:654: undefined reference to `vtkPolyDataMapper::SetInput(vtkPolyData*)'

main.o: In function `vtkGlyph3D::SetSource(vtkPolyData*)':
/mnt/home/yazaydin/VTK/include/vtk-5.8/vtkGlyph3D.h:111: undefined reference to `vtkGlyph3D::SetSource(int, vtkPolyData*)'
/mnt/home/yazaydin/VTKjob/MFI-nC6/YZ/main.c:1421: undefined reference to `vtkImageAlgorithm::SetInput(vtkDataObject*)'



Could you give me some guidance how to link the VTK library to the code.


Best regards
Lifeng






My Makefile
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

CC          = g++
CLINKER     = g++

CFLAGS      = -I/mnt/home/yazaydin/VTK/include/vtk-6.0 -Wall -O3 -g -m64
LIBS        = -L/mnt/home/yazaydin/VTK/lib/vtk-6.0 -lvtkCommon -lvtkFiltering -lvtkImaging -lvtkGraphics -lvtkGenericFiltering -lvtkIO -lvtkRendering -lvtkVolumeRendering -lvtkHybrid -lvtkWidgets -lvtkInfovis -lvtkGeovis -lvtkViews -lvtkCharts -lvtkChemistry

OBJS        = main.o
EXECS       = simulate

default: simulate

all: $(EXECS)

simulate:$(OBJS)
                $(CLINKER) $(OPTFLAGS) -o simulate $(OBJS) $(LIBS)

clean:
                /bin/rm -f *.o *~ PI* $(EXECS)

.c.o:
                $(CC) $(CFLAGS) -c $*.c
.f.o:
                $(F77) $(FFLAGS) -c $*.f

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120326/c0cd802f/attachment.htm>


More information about the vtkusers mailing list