[vtkusers] Re: problems building simple executable

Goodwin Lawlor goodwin.lawlor at ucd.ie
Tue Nov 2 06:52:03 EST 2004


Hi Robert,
How about using cmake with a simple CMakeLists.txt config file from here:
http://www.vtk.org/Wiki/VTK_FAQ#Writing_a_simple_CMakeLists.txt.
to build your make file for you.

hth

Goodwin


"Robert S Laramee" <laramee at vrvis.at> wrote in message
news:20041102113554.C7D3C5B1D8 at mail2.avl.com...
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/
_______________________________________________
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