[vtkusers] problems building simple executable
Robert S Laramee
laramee at vrvis.at
Tue Nov 2 06:35:55 EST 2004
Dear Fellow VTK Users,
i'm trying to build a simple
exectuable here, that is, i'm
trying to convert:
VTK/Examples/Rendering/TCL/CADPart.tcl
to C++. i'm having a little trouble
getting started. i've included the
lines:
#include "vtkSTLReader.h"
...
vtkSTLReader *part = vtkSTLReader::New();
It looks like there is no problem
building the object file, BobsApp.o,
however, it looks like there's a linking
problem, i.e., i get this error message:
[larameer at lnxc25 Cxx]$ make
Building object file BobsApp.o...
Building executable ./BobsApp...
/home/larameer/evaluation/vtk/vtk-src-unix/bin/libvtkIO.a(vtkSTLReader.o): In
function `vtkSTLReader::CreateDefaultLocator(void)':
vtkSTLReader.o(.text+0x1bec): undefined reference to
`vtkMergePoints::New(void)'
/home/larameer/evaluation/vtk/vtk-src-unix/bin/libvtkIO.a(vtkSTLReader.o): In
function `vtkByteSwap::Swap4LE(float *)':
vtkSTLReader.o(.vtkByteSwap::gnu.linkonce.t.Swap4LE(float *)+0xe): undefined
reference to `vtkByteSwap::Swap4LE(char *)'
/home/larameer/evaluation/vtk/vtk-src-unix/bin/libvtkIO.a(vtkSTLReader.o): In
function `vtkByteSwap::Swap4LE(unsigned long *)':
vtkSTLReader.o(.vtkByteSwap::gnu.linkonce.t.Swap4LE(unsigned long *)+0xe):
undefined reference to `vtkByteSwap::Swap4LE(char *)'
collect2: ld returned 1 exit status
make[1]: *** [BobsApp] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [default_target] Error 2
Any ideas what the problem is?
i don't understand this because i've included
-lvtkIO into the linking. My Makefile looks like
the following.
#---------------------------------------------------------
# executable
#
./BobsApp: $(BobsApp_SRC_OBJS) $(BobsApp_DEPEND_LIBS)
echo "Building executable ./BobsApp..."
c++ \
-I/usr/X11R6/include \
-fPIC $(BobsApp_SRC_OBJS) \
-o ./BobsApp -rdynamic \
-L/home/larameer/evaluation/vtk/vtk-src-unix/bin \
-L. \
-L/usr/X11R6/lib \
-lvtkRendering \
-lvtkGraphics \
-lvtkImaging \
-lvtkFiltering \
-lvtkCommon \
-lpthread \
-lvtkIO \
-ldl -lm -lSM -lICE -lSM -lICE -lX11 -lXext -lX11 -lXext -lvtkftgl -lGLU
-lGL -lvtkfreetype -lXt -lSM -lICE -lX11 -lXext
-Wl,-rpath,/home/larameer/evaluation/vtk/vtk-src-unix/bin:.:/usr/X11R6/lib
Any feedback is most appreciated.
-cheers, bob
--
Robert S. Laramee
tel: +43 (316) 787-1740
fax: +43 (316) 787-777
http://www.VRVis.at/ar3/pr2/
John Kerry for President: http://www.johnkerry.com/
More information about the vtkusers
mailing list