Problems Linking libVTKGraphics.so

klaatu klaatu at clark.net
Sat Apr 1 09:07:44 EST 2000


On Fri, 31 Mar 2000, Eduardo Kortright wrote:

> Hello all,
> 
> First of all, thanks to Klaatu and David for their help with Java.
> 
> Sorry to keep pestering the group, but when trying to compile VTK 3.1
> under Linux, I am still having problems.  
> 
> I did a 
> 	./configure --with-mesa --with-opengl --with-shared --with-tcl \
> 		--with-patented --with-contrib --with-java --with-tkwidget --with-x
> and edited system.make to include pthread support.
> 
> Everything compiles fine.  The problem now seems to be linking 
> libVTKGraphics.so.  I get dozens of "multiple definition" messages such
> as:
> 
> 	vtkMesaPolyDataMapper.o: In function
> `vtkOpenGLBeginPolyTriangleOrQuad(GLenum, GLenum &, int)':
> 	/usr/local/vtk3.1/graphics/vtkOpenGLPolyDataMapper.cxx:335: multiple
> definition of 
> 		`vtkOpenGLBeginPolyTriangleOrQuad(GLenum, GLenum &, int)'
> 
> vtkOpenGLPolyDataMapper.o:/usr/local/vtk3.1/graphics/vtkOpenGLPolyDataMapper.cxx:335:
> first defined here
> 
> The whole thing dies with:
> 
> 	collect2: ld returned 1 exit status
> 	make[1]: *** [libVTKGraphics.so] Error 1
> 	make: *** [build_graphics] Error 2
> 
> Has anyone seen anything like this before?

I haven't seen that, but if you're building with Linux and "glibc", sheck
to make sure that you're passing to the CFLAGS the term -D_REENTRANT and
in the libraries pass -lpthread

I suspect that to find the multiple-definition problem you're going to
have to get into the always-fun process of reading the errors, seeing
where it says "first defined here (foo.cxx:line)" and looking at it. If
you've got multiple definitions, better bring it to the attention of the
authors, if you don't feel comfortable either commenting it out or
rewriting it yourself. 

Also, you might have your compiler debug level set too high, sometimes if
you've got it set too high, the compiler will barf even though it might
actually successfully run had it compiled with a lower debug level set.

Then again, I am just firing blind on this since I haven't got the code in
front of me (low on drivespace).

> 
> --
> Eduardo Kortright			Department of Computer Science

--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list