Subject: libg++-2.6.2 doesn't build
To: None <current-users@NetBSD.ORG>
From: Arthur Hoffmann <hoffmann@it.ntu.edu.au>
List: current-users
Date: 04/22/1995 21:15:28
Hi, I was just wondering if anyone got libg++-2.6.2 to compile on a
NetBSD1.0A box? I'm running NetBSD1.0A on an Amiga.
I first built gcc-2.6.3 which went without any problems, I installed
the following patch to it: (this was posted here earlier)
----This was posted on one of the NetBSD lists recently---
Tue, 14 Mar 1995, Olaf Seibert wrote:
> I installed gcc 2.6.3 from the binary package at ftp.netbsd.org,
> and with g++ I'm having trouble with template functions being
> multiply defined.
>
> /var/tmp/cc0004021.o: Definition of symbol `_split__t10DoubleList1Zi' (multiply defined)
> /var/tmp/cc0004022.o: Definition of symbol `_split__t10DoubleList1Zi' (multiply defined)
I extracted the sources out of your example and tried with my
slightly-patched version of gcc-2.6.3. I had no problems. (It's this
same patch that allows gcc-2.6.3 to successfully compile libg++-2.6.2 on
NetBSD.) Perhaps it could be included in the binary package?
[forwarded message follows]
This patch fixes the multiply defined template functions bug
which was introduced in 2.6.1.
Jason
*** ../../gcc-2.6.3/cp/pt.c Mon Nov 14 23:34:29 1994
--- pt.c Mon Dec 12 21:10:06 1994
***************
*** 2302,2307 ****
--- 2302,2311 ----
else if (! flag_implicit_templates)
DECIDE (0);
+ if (i->interface == 1)
+ /* OK, it was an implicit instantiation. */
+ TREE_PUBLIC (t) = 0;
+
/* If it's a method, let the class type decide it.
@@ What if the method template is in a separate file?
Maybe both file contexts should be taken into account?
Scott Reynolds
----End of Patch----
The followin are the errors I get when I did make -k
-----Eroor Messages------
cd src; make all ...
gcc -c -g -nostdinc++ -I. -I../../libio -I. -I./../../libio -I./../src
Fix.cc
Fix.cc: In function `static struct Fix::Rep * Fix::multiply(const
struct Fix::Rep *, const struct Fix::Rep *, struct Fix::Rep * = 0)':
Fix.cc:301: call of overloaded constructor `Fix(unsigned int)' is
ambiguous
./Fix.h:232: candidates are: Fix::Fix(const Fix &)
./Fix.h:218: Fix::Fix(int)
./Fix.h:226: Fix::Fix(double)
Fix.cc:301: in base initialization for class `Fix'
Fix.cc:301: call of overloaded constructor `Fix(unsigned int)' is
ambiguous
./Fix.h:232: candidates are: Fix::Fix(const Fix &)
./Fix.h:218: Fix::Fix(int)
./Fix.h:226: Fix::Fix(double)
Fix.cc:301: in base initialization for class `Fix'
Fix.cc: In function `static struct Fix::Rep * Fix::divide(const struct
Fix::Rep *, const struct Fix::Rep *, struct Fix::Rep * = 0, struct
Fix::Rep * = 0)':
Fix.cc:371: call of overloaded constructor `Fix(unsigned int)' is
ambiguous
./Fix.h:232: candidates are: Fix::Fix(const Fix &)
./Fix.h:218: Fix::Fix(int)
./Fix.h:226: Fix::Fix(double)
Fix.cc:371: in base initialization for class `Fix'
Fix.cc:386: call of overloaded constructor `Fix(unsigned int)' is
ambiguous
./Fix.h:232: candidates are: Fix::Fix(const Fix &)
./Fix.h:218: Fix::Fix(int)
./Fix.h:226: Fix::Fix(double)
Fix.cc:386: in base initialization for class `Fix'
*** Error code 1 (continuing)
`all' not remade because of errors.
cd tests; make all ...
cd gperf; make all ...
cd src ; make ... all
gcc -o gperf new.o options.o iterator.o main.o gen-perf.o key-list.o
list-node.o hash-table.o bool-array.o read-line.o std-err.o version.o
-L./../../ -lg++
options.cc:204: Undefined symbol `___6GetOptiPPcPCc' referenced from
text segment
options.cc:211: Undefined symbol `___cl__6GetOpt' referenced from text
segment
hash-table.cc:73: Undefined symbol `_hashpjw__FPCc' referenced from
text segment
*** Error code 1 (continuing)
`all' not remade because of errors.
----End of Errors----
Does anyone have any hints about what I should do?
Thanks.
Arthur.
__
Arthur Hoffmann hoffmann@it.ntu.edu.au