Linking shared Objects with gcc 3.0.2

From: Lars Sitzmann <sitzmann_at_o-s-c.de>
Date: Thu, 10 Jan 2002 18:22:05 +0100

Hello,

I have trouble linking shared objects and applications using shared objects
on a true64 V5.1 system with gcc 3.0.2 compiler.

I build the gcc 3.0.2 on my system with
configure && make bootstrap && make install
without any problems.

I compile my source files with statements like:

gcc -c -g -fPIC -Wall src/PROG1.cpp -o dst/PROG1.o
...

Then I link my shared object this way:

g++ -shared -nostartfiles -nostdlib -lc -lm dst/PROG1.o dst/PROG2.o -lgcc -lpthread -lrt -o /lib/libMySharedLib.so.1 -lm

This produces no errors and an shared-object-file, but aswell warnings like:

dst/PROG1.o: typeinfo for XXXXXX: weak symbol multiply defined
[...lots of these!!]
Warning: Unresolved:
operator new[](unsigned long)
operator delete(void*)
vtable for __cxxabiv1::__si_class_type_info
vtable for __cxxabiv1::__class_type_info
__gxx_personality_v0
operator new(unsigned long)
__cxa_pure_virtual
vtable for __cxxabiv1::__vmi_class_type_info
operator delete[](void*)
/bin/ld:
dst/PROG1.o: _ZTS8BSObject: weak symbol multiply defined
[... lots of these!!]
Warning: Unresolved:
_Znam
_ZdlPv
_ZTVN10__cxxabiv120__si_class_type_infoE
_ZTVN10__cxxabiv117__class_type_infoE
__gxx_personality_v0
_Znwm
__cxa_pure_virtual
_ZTVN10__cxxabiv121__vmi_class_type_infoE
_ZdaPv

Now, when I try to use my shared object like this:

gcc dst/hello_world.o -o testprogs/hello_world -Llib -g -lMySharedLib

I get the following error messages:

/bin/ld:
Unresolved:
operator delete(void*)
__gxx_personality_v0
collect2: ld returned 1 exit status


What am I doing wrong?
Under true64 V4.0 and gcc 2.95.3 everything works out fine
(using the same parameters).

Thanks for any suggestions and greetings from germany...


Lars

_______________________________________
OSC - OFFIS Systems and Consulting GmbH
Lars Sitzmann
Bereichsleiter
Geoinformationssysteme
Industriestraße 11, 26121 Oldenburg
Tel.: 04 41/3 50 42-3 04, Fax: -3 80, Zentrale: -0
E-Mail: sitzmann_at_o-s-c.de
URL: http://www.o-s-c.de
     http://www.InterGIS.de
Received on Thu Jan 10 2002 - 17:29:02 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:43 NZDT