Warnings about multiply defined weak symbol

Jason Merrill jason@cygnus.com
Wed May 27 11:03:00 GMT 1998


>>>>> Erik Moe <ehm@concentric.net> writes:

> ld: WARNING 131: Multiply defined weak symbol:(basic_string<char,
> string_char_traits<char>, __default_alloc_template<0, 0>
>> ::~basic_string(void)) in main.o and /usr/local/lib/libstdc++.a(stdexcepti.o) (2nd definition ignored).

> What is possibly generating this warning?

The basic_string destructor is being generated as needed.  Two translation
units that use it are your main.C and stdexcepti.C in the library.  Since
they use weak symbols, only one will be used by the executable (though both
will take up space until GNU ld works on Irix 6).  You can ignore this
warning, or use -frepo to avoid the duplicates.

Jason



More information about the Gcc-bugs mailing list