[vtkusers] Building VTK on Gnu/Debian errors

Xiaobin Wang xiaobin2006 at gmail.com
Mon Sep 11 10:38:33 EDT 2006


Hi,
Thank you for keeping on help me about building vtk.
I installed mayavi (apt-get install) ,and configure vtk ,make and make
install .
This time  no errors came out .I am very happy about it .

However , when I try to complie a program using vtk libararies ,new problem
comes .
Compiling and linking seem good ,no errors at all.
But when I run the generated executable , it tells me "error while loading
shared libraries: libvtkCommon.so.5.0: cannot open shared object file,no
such file or directory" . I check in /usr/local/lib/ ,libvtkCommon.so.5.0 is
there and all users have permission to access it . So I wonder why it
produces such
error information and how to overcome .

My g++ options are followings ( from Makefile,by the way,I appended
-L/usr/local/lib to avoid conficting with vtk libraries in /usr/lib/ ,which
are installed when mayavi installed . May I remove them ? thay are vtk
version 4
libraries)

CXX := g++
PROG := myprog
CSRC := $(PROG).cxx
PREFIX := /usr/local
INC := -I$(PREFIX)/include/vtk-5.0
LIB := -lm -lvtkCommon -lvtkIO -lvtkWidgets -lvtkRendering -L/usr/local/lib

CXXFLAGS := -Wall -O2 -Wno-deprecated

.PHONY: all clean depend distclean edit install

all: $(PROG)

$(PROG): $(CSRC:.cxx=.o)
    $(CXX) -o $@ $(CSRC:.cxx=.o) $(LIB)

%.o: %.cxx
    $(CXX) -c $(INC) $(CXXFLAGS) $<
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060911/db477979/attachment.htm>


More information about the vtkusers mailing list