This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Please, a word of help (Was: Re: egcs 1.1.1: apparently multiple library inclusion??)


Last week on the egcs list I myself wrote:
>
>Hi, I just installed egcs for evaluation, and I have a bit of a
>problem during linking.

No responses, sorry if my question was obscure... or just a
FAQ?  Because if it is a FAQ, I certainly didn't find in the
egcs.cygnus.com FAQ.

I'm ready to do any testing or reinstalling or whatever, I've
already installed this three times, with another person doing
an independent install on a different machine, but always the
same results.  I'm getting desperate, I don't want to rewrite
all those things that were so easy to write using the STLs.

My feeling is that is I could manage to get these obscure errors
every time, someone must have come across them before...

Anyone?

>At first, compiling my existing C and C++ code, no problems.
>Then I spent two days adding in STL lists, compiling the object
>files as I went, with (finally, at least ;-)) no errors.  (No, I
>did not forget the make clean...)
>
>The first errors that come out of the linker are:
>% ./display_npl.o: In function `int lexicographical_compare_3way<signed char const *, signed char const *>(signed char const *, signed char const *, signed
>char const *, signed char const *)':
>% /usr/include/g++-2/stl_algobase.h(.text+0x0): multiple definition of `operator new(unsigned int, void *)'
>% ./main.o(.text+0x0):/usr/include/g++-2/stl_algobase.h: first defined here
>% ./display_npl.o: In function `operator new [](unsigned int, void *)':
>% /usr/lib/gcc-lib/i486-linux/egcs-2.91.60/include/new:43: multiple definition of `operator new [](unsigned int, void *)'
>% ./main.o:/usr/lib/gcc-lib/i486-linux/egcs-2.91.60/include/new:43: first defined here
>% ./display_npl.o: In function `ios::init(streambuf *, ostream *)':
>% /usr/include/g++-2/streambuf.h:469: multiple definition of `ios::init(streambuf *, ostream *)'
>% ./main.o:/usr/include/g++-2/streambuf.h:469: first defined here
>
>I don't get it.  Does this mean that the offending definitions,
>the ones that can not be made multiple times, are made and
>included in each object file?
>
>How do I correct that?
>
>
>FWIW, the errors get even funnier; using a different machine,
>system and egcs installed by a different person, AFAICS
>according to the recommendations in the egcs documentation:
>
>	su - sysop
>	cd /home/sysop/egcs-compile
>	../egcs-untar/configure --prefix=/usr/local/egcs
>	make
>	make install
>	logout
>	export PATH=/usr/local/egcs/bin:$PATH
>	cd project_sources
>        ./configure
>	make
>
>I have one definition in a .h that is in the compilation
>directories /home/sysop/egcs-compile, which are unreadable
>for the user doing the compile, and the other in
>/usr/local/egcs/whatever.  I suppose that means that a library
>is generated during egcs compilation, and that library is put in
>/usr/local/egcs, and that I somehow contrive to include both?
>
>Anyway, if someone could point me in the right direction, I'd be
>very happy, I'm going in circles here.  More info upon request.

-- 
#include <std_disclaim.h>                          Lorens Kockum


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]