Multiply defined symbols during linking...

Rick Harding svlad@best.com
Mon Sep 29 23:30:00 GMT 1997


Attached is a uuencoded tar'd, gzip'd test case that illustrates the
problem.

The virtual functions defined in the template class MValue in file F.h
(necessary due to the inheritance from the abstract base class Base)
seem to be causing the problem. If you eliminate the virtual functions
it will link just fine.

This very same code compiles on EDG based compilers such as MipsPro
7.0.1 under IRIX 6.2.
 
> >
> > Hi,
> >
> > I'm using the 970924 snapshot on a i586-pc-linux-gnulibc1 configuration.
> > I'm building a shared library that uses the STL. I get errors, during
> > linking, for multiply defined symbols in algobase.h:
> >
> > __copy_dispatch<T **, T **>::__copy_dispatch(void)
> > __copy_backward_dispatch<T **, T **>::__copy_backward_dispatch(void)
> >
> > where T is any one of the various classes I have defined in my library.
> >
> 
> Do you have a simple test case?
> 
> H.J.



-- Rick Harding

====================================================================
   ...Be careful whose advice you buy, but be patient with those
   who supply it. Advice is a form of nostalgia.  Dispensing it
   is a way of fishing the past from the disposal, wiping it off,
   painting over the ugly parts and recycling it for more	
   than it's worth...
                                         - K. Vonnegut
====================================================================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test
Type: application/x-gzip
Size: 1086 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/19970929/b827cef3/attachment.bin>


More information about the Gcc-bugs mailing list