ld: fatal error : symbols multiply-defined

ld: fatal error : symbols multiply-defined

Post by Greg O » Wed, 21 Aug 2002 15:01:43



Hello,

I am using ld's -r option to build combine several object files into a
single relocatable object file. This works fine but when I then
include this new relocatable object file into another ld command to
create an executable I get the following errors:

ra: /export/home/greg/code/prog >cc -dn -o invoker invoker.c testies.o
ld: fatal: symbol `_start' is multiply-defined:
(file /opt/SUNWspro/WS6U2/lib/crt1.o and file testies.o);
ld: fatal: symbol `_environ' is multiply-defined:
(file /opt/SUNWspro/WS6U2/lib/crt1.o and file testies.o);
ld: fatal: symbol `_init' is multiply-defined:
(file /opt/SUNWspro/WS6U2/lib/crti.o and file testies.o);
ld: fatal: symbol `___Argv' is multiply-defined:
(file /opt/SUNWspro/WS6U2/lib/crt1.o and file testies.o);
ld: fatal: symbol `__cg92_used' is multiply-defined:
(file /opt/SUNWspro/WS6U2/lib/crt1.o and file testies.o);
ld: fatal: symbol `_lib_version' is multiply-defined:
(file /opt/SUNWspro/WS6U2/lib/values-xa.o and file testies.o);
ld: fatal: symbol `__environ_lock' is multiply-defined:
(file /opt/SUNWspro/WS6U2/lib/crt1.o and file testies.o);
ld: fatal: symbol `_fini' is multiply-defined:
(file /opt/SUNWspro/WS6U2/lib/crti.o and file testies.o);
ld: fatal: File processing errors. No output written to invoker

I am running Solaris8.

Any ideas on how to fix this?

It appears the objects crt1.o, crti.o and values-xa.o are being
linked-in twice...each time ld is invoked. Is there any way to stop
this?

Thanks,
Greg

 
 
 

ld: fatal error : symbols multiply-defined

Post by Greg O » Thu, 22 Aug 2002 14:20:50



> Hello,

> I am using ld's -r option to build combine several object files into a
> single relocatable object file. This works fine but when I then
> include this new relocatable object file into another ld command to
> create an executable I get the following errors:

> ra: /export/home/greg/code/prog >cc -dn -o invoker invoker.c testies.o
> ld: fatal: symbol `_start' is multiply-defined:
> (file /opt/SUNWspro/WS6U2/lib/crt1.o and file testies.o);
> ld: fatal: symbol `_environ' is multiply-defined:
> (file /opt/SUNWspro/WS6U2/lib/crt1.o and file testies.o);
> ld: fatal: symbol `_init' is multiply-defined:
> (file /opt/SUNWspro/WS6U2/lib/crti.o and file testies.o);
> ld: fatal: symbol `___Argv' is multiply-defined:
> (file /opt/SUNWspro/WS6U2/lib/crt1.o and file testies.o);
> ld: fatal: symbol `__cg92_used' is multiply-defined:
> (file /opt/SUNWspro/WS6U2/lib/crt1.o and file testies.o);
> ld: fatal: symbol `_lib_version' is multiply-defined:
> (file /opt/SUNWspro/WS6U2/lib/values-xa.o and file testies.o);
> ld: fatal: symbol `__environ_lock' is multiply-defined:
> (file /opt/SUNWspro/WS6U2/lib/crt1.o and file testies.o);
> ld: fatal: symbol `_fini' is multiply-defined:
> (file /opt/SUNWspro/WS6U2/lib/crti.o and file testies.o);
> ld: fatal: File processing errors. No output written to invoker

> I am running Solaris8.

> Any ideas on how to fix this?

> It appears the objects crt1.o, crti.o and values-xa.o are being
> linked-in twice...each time ld is invoked. Is there any way to stop
> this?

> Thanks,
> Greg

Solved my problem by using a 'ar' archive library for my objects
instead of a combined relocatable object. The .a file works a treat!

 
 
 

1. Problem: ld (linker) giving multiply defined symbol fatal errors

Here is an example of the error I am getting

ld: fatal: symbol `psIngresPersistentStore::FetchAttribute(moAttribute*,valMoAttrValue*,
        aecErrorData&)' is multiply defined:

        (file /tcs/patch/PSIngres/psIngresPersistentStore.o and
         file /tcs/tcore/debug/libPSIngres.a(psIngresPersistentStore.o));

This is a problem becuase I had released some "patches" to replace (override) existing
functions in libraries. I cannot change these libraries.

Is there some ld option (that I am overlooking) that ignores the second symbol definition ?

I'd really appreciate some quick help on this one.

Vijay

2. lockscreen in KDE

3. ld: fatal: symbol `_init' is multiply defined???

4. Deleted Linux (Fdisk)! Can't access partition!!

5. ld: multiply defined symbol

6. how to disable Solaris accept ISP dynamic hostname ??

7. chasing down multiply-defined symbols

8. Corrupt label: bad magic number - sd.so(0,0,0)/vmunix: can not open

9. ld multiply defined error

10. : ld error: _tolower & _toupper multiply defined

11. solaris,apache,mod_perl,php: Make bombs symbol `Error' is multiply defined

12. ld.so.1: /opt/bin/apache/httpd: fatal: ... symbol ap_make_sub_pool: referenced symbol not found

13. ld: fatal: Symbol referencing errors