From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1153c9,ee0136362e89eed4,start X-Google-Attributes: gid1153c9,public X-Google-Thread: 1164f8,ee0136362e89eed4,start X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 2002-01-14 08:02:13 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.netcologne.de!newsfeed01.sul.t-online.de!t-online.de!dns.phoenix-ag.de!news.uni-stuttgart.de!uniol!newssrv2.hrz.uni-oldenburg.de!not-for-mail From: Lars Sitzmann Newsgroups: comp.sys.dec,comp.unix.true64 Subject: Linking shared Objects with gcc 3.0.2 on True64 V5.1 Date: Mon, 14 Jan 2002 16:37:57 +0100 Organization: Universitaet Oldenburg Germany Message-ID: <3C42FB55.B54CD128@o-s-c.de> NNTP-Posting-Host: pcosc05.offis.uni-oldenburg.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: newssrv2.hrz.uni-oldenburg.de 1011022976 27385 134.106.50.15 (14 Jan 2002 15:42:56 GMT) X-Complaints-To: news@newssrv2.hrz.uni-oldenburg.de NNTP-Posting-Date: 14 Jan 2002 15:42:56 GMT X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en Xref: archiver1.google.com comp.sys.dec:11512 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