gnu.gcc.help
[Top] [All Lists]

Re: ingnoring multiple definitions...

Subject: Re: ingnoring multiple definitions...
From: Paul Pluzhnikov
Date: Tue, 18 Jul 2006 16:23:10 -0700
Newsgroups: gnu.gcc.help
"Prasad" <tprasadg@xxxxxxxxx> writes:

> I'm trying to build a package on Solaris but run into errors like ...
...
> ld: fatal: symbol `_vt.15CORBA_ExContext' is multiply-defined:
>       (file libcorba.a(tdlcorba_nd.o) and file libcorba.a(except_nd.o));

The best thing to do is to fix this problem, rather than forcing
the linker to build you a bloated executable.

The fix is to make sure that all your classes that have virtual
methods also declare a virtual destructor, which is not inlined.

> I trying to see if the multiple definition could be ignored by gcc. I
> attempted to  "-z muldefs" with ld but still run into the same error.

It is not clear what the statement above means; but in any case you
should never link any user-level code on Solaris directly with 'ld'.

> I read in gcc manuals about the linker option "-Xlinker" so I used
> -Xlinker -z -Xlinker muldefs with gcc/g++ but got this info
> ***********
> gcc: -z: linker input file unused since linking not done
> gcc: muldefs: linker input file unused since linking not done

That means you put '-Xlinker -z -Xlinker muldefs' on *compile* line.

You should forget all about -Xlinker, and add '-Wl,-z,muldefs'
to the *link* line.

> I'm onto try unsing the -Wl, option (-Wl,
> -zmuldefs) with gcc ... will this help!!

Huh?

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy