Undefined Symbols:

Erik Christiansen dvalin at internode.on.net
Wed Nov 12 08:47:57 UTC 2008


On Wed, Nov 12, 2008 at 11:28:33AM +0530, Chaman Singh Verma wrote:
> Still, I get these errors.
> 
> Can someone help ?

> /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/crti.o: In function
> `_init':
> /build/buildd/glibc-2.8~20080505/build-tree/amd64-libc/csu/crti.S:25:
> multiple definition of `_init'
> /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/crti.o:/build/buildd/glibc-2.8~20080505/build-tree/amd64-libc/csu/crti.S:25:
> first defined here

It says that two copies of crti.S are being linked, resulting in
duplicate symbol definition. Since one copy shouldn't be there, you need
only identify which one should be there, and remove the other from your
link stage.

The first greatly resembles the initialisation code coming with a 64-bit
native gcc. The second looks suspiciously like it's from a glibc
snapshot from May.

Exclude the one which shouldn't be there, and the error will evaporate.

> /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/crti.o: In function
> `_fini':
> /build/buildd/glibc-2.8~20080505/build-tree/amd64-libc/csu/crti.S:37:
> multiple definition of `_fini'
> /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/crti.o:/build/buildd/glibc-2.8~20080505/build-tree/amd64-libc/csu/crti.S:37:
> first defined here

Same as above.

> /usr/lib/gcc/x86_64-linux-gnu/4.3.2/crtbeginS.o:(.data.rel+0x0): multiple
> definition of `__dso_handle'
> /usr/lib/gcc/x86_64-linux-gnu/4.3.2/crtbeginS.o:(.data.rel+0x0): first
> defined here
> /usr/lib/gcc/x86_64-linux-gnu/4.3.2/crtendS.o:(.dtors+0x0): multiple
> definition of `__DTOR_END__'
> /usr/lib/gcc/x86_64-linux-gnu/4.3.2/crtendS.o:(.dtors+0x0): first defined
> here

These, in the object file, are likely to vanish when the extraneous
library is no longer linked.

> collect2: ld returned 1 exit status

That results from the above problem.

How have you achieved this effect? Even with both paths in the
library path (-L ...), it should only link the first found.

Whether you're building from a howto, or installing a source package, my
advice is to rip it all out, and start again. One copy of the libraries
is sufficient.

Erik

-- 
The universe is ruled by letting things take their course.  It cannot be
ruled by interfering.
                -- Chinese proverb





More information about the ubuntu-users mailing list