Subject: g++ problem / -fno-implicit-templates
From: [email-masked] (Martin Goik)

2 Sep 1997 01:38:49 -0700
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
X-Mailer: Mozilla 3.01Gold (X11; I; Linux 2.0.29 i586)
MIME-Version: 1.0
Original-To: [email-masked]
Original-CC: [email-masked]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Original-Sender: [email-masked]

I still have a cygnus-gcc problem which was not present with gnu
gcc-2.7.2.1 . Trying to compile and link 3 C++ modules containing STL
code plus one C-module yields:

hpe>make
cc -g -I. -I/hpe2/goik/simba/include  -Aa +u1 -D_HPUX_SOURCE -D_SVID2  
-c api.c -o api.o
g++ -g -I. -I/hpe2/goik/simba/include  -D_HPUX_SOURCE -D_SVID2
-fexceptions    -c odbctypes.cc -o odbctypes.o
g++ -g -I. -I/hpe2/goik/simba/include  -D_HPUX_SOURCE -D_SVID2
-fexceptions    -c sessionmgr.cc -o sessionmgr.o
g++ -g -I. -I/hpe2/goik/simba/include  -D_HPUX_SOURCE -D_SVID2
-fexceptions    -c s3api.cc -o s3api.o
ar rs simbadrm.a api.o odbctypes.o sessionmgr.o s3api.o
g++ -o simbatst /hpe2/goik/simba/lib/debug/simbatst.a
/hpe2/goik/simba/lib/debug/simbaeng.a simbadrm.a -lm
/usr/ccs/bin/ld: Duplicate symbol "__default_alloc_template<false,
0>::start_free" in files simbadrm.a(s3api.o) and simbadrm.a(odbctypes.o)
/usr/ccs/bin/ld: Duplicate symbol "__default_alloc_template<false,
0>::free_list" in files simbadrm.a(s3api.o) and simbadrm.a(odbctypes.o)
/usr/ccs/bin/ld: Duplicate symbol "__default_alloc_template<false,
0>::heap_size" in files simbadrm.a(s3api.o) and simbadrm.a(odbctypes.o)
/usr/ccs/bin/ld: Duplicate symbol "__default_alloc_template<false,
0>::end_free" in files simbadrm.a(s3api.o) and simbadrm.a(odbctypes.o)
/usr/ccs/bin/ld: Duplicate symbol "__default_alloc_template<false,
0>::start_free" in files simbadrm.a(s3api.o) and
simbadrm.a(sessionmgr.o)
/usr/ccs/bin/ld: Duplicate symbol "__default_alloc_template<false,
0>::free_list" in files simbadrm.a(s3api.o) and simbadrm.a(sessionmgr.o)
/usr/ccs/bin/ld: Duplicate symbol "__default_alloc_template<false,
0>::heap_size" in files simbadrm.a(s3api.o) and simbadrm.a(sessionmgr.o)
/usr/ccs/bin/ld: Duplicate symbol "__default_alloc_template<false,
0>::end_free" in files simbadrm.a(s3api.o) and simbadrm.a(sessionmgr.o)
/usr/ccs/bin/ld: Found 8 duplicate symbol(s)
collect2: ld returned 1 exit status
make: *** [simbatst] Error 1
hpe>

Architecture + compiler + OS:

hpe>uname -a
HP-UX hpe B.10.20 B 9000/816 951328282 16-user license
hpe>gcc -v
Reading specs from
/hpe2/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/cygnus-2.7.2-970404/specs
gcc version cygnus-2.7.2-970404
hpe>as --version
GNU assembler cygnus-2.8.1
Copyright 1997 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms
of
the GNU General Public License.  This program has absolutely no
warranty.
This assembler was configured for a target of `hppa1.1-hp-hpux10.20'.

Ulrich Drepper already gave me a hint to use the -fno-implicit-templates
option . But then I get lots of "Unsatisfied symbols" messages due to
STL depending on which subset of modules I use this option:

g++ -o simbatst /hpe2/goik/simba/lib/debug/simbatst.a
/hpe2/goik/simba/lib/debug/simbaeng.a simbadrm.a -lm
/usr/ccs/bin/ld: Unsatisfied symbols:
   rb_tree<unsigned long, pair<unsigned long const,
OdbcTypesTable::iterator>, select1st<pair<unsigned long const,
OdbcTypesTable::iterator> >, less<unsigned long>,
__default_alloc_template<false, 0>
>::__erase(__rb_tree_node<pair<unsigned long const, OdbcTypesTable::iterator> > *)(code)
   rb_tree<unsigned long, pair<unsigned long const,
OdbcTypesTable::iterator>, select1st<pair<unsigned long const,
OdbcTypesTable::iterator> >, less<unsigned long>,
__default_alloc_template<false, 0> >::insert_unique(pair<unsigned long
const, OdbcTypesTable::iterator> const &)(code)
   __default_alloc_template<false, 0>::free_list(data)
   rb_tree<unsigned long, pair<unsigned long const, S3Table *>,
select1st<pair<unsigned long const, S3Table *> >, less<unsigned long>,
__default_alloc_template<false, 0> >::insert_unique(pair<unsigned long
const, S3Table *> const &)(code)
   rb_tree<unsigned long, pair<unsigned long const,
OdbcTypesTable::iterator>, select1st<pair<unsigned long const,
OdbcTypesTable::iterator> >, less<unsigned long>,
__default_alloc_template<false, 0> >::find(unsigned long const &)(code)
   __default_alloc_template<false, 0>::refill(unsigned int)(code)
   rb_tree<unsigned long, pair<unsigned long const, S3Table *>,
select1st<pair<unsigned long const, S3Table *> >, less<unsigned long>,
__default_alloc_template<false, 0> >::find(unsigned long const &)(code)
   rb_tree<unsigned long, pair<unsigned long const, S3Table *>,
select1st<pair<unsigned long const, S3Table *> >, less<unsigned long>,
__default_alloc_template<false, 0>
>::__erase(__rb_tree_node<pair<unsigned long const, S3Table *> > *)(code)
   rb_tree<unsigned long, pair<unsigned long const,
OdbcTypesTable::iterator>, select1st<pair<unsigned long const,
OdbcTypesTable::iterator> >, less<unsigned long>,
__default_alloc_template<false, 0> >::find(unsigned long const &)
const(code)
   __malloc_alloc_template<0>::oom_malloc(unsigned int)(code)
collect2: ld returned 1 exit status
make: *** [simbatst] Error 1

Any Help?
-- 
Martin Goik Software engineer Phone:+49-721-91210-32 Fax:+49-721-27126
ABAS-Software AG      Viktoriastr. 8       76133 Karlsruhe     Germany
http://www.abas.de                         http://www.iai.fzk.de/~goik 
Unsolicited commercial e-mail will be billed at $250/message.
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".