This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Template Instantiation problem
- To: <gcc-bugs at gcc dot gnu dot org>
- Subject: Template Instantiation problem
- From: Tracy Vandeventer <tracy at col dot hp dot com>
- Date: Thu, 9 Mar 2000 18:41:11 -0700
- Cc: <tracy_vandeventer at agilent dot com>
Good morning,
We are currently trying to move our code base from HPUX cfront C++ to
g++! We are experiencing many problems, but I hope that you can help
me with this issues.
* Failure of allocation of a static class variable that is needed
during template instatiation.
Included in the archive are:
Complex.c - the main routine.
Complex.ii
Complex.s
List.c - the definition of a template.
List.h - the declaration of a template.
Pool.h - used by List.h
README - this file
lib++.a - a library (HPUX) - probably not needed!
x - a script that shows how I'm compiling and linking
x.out - output from executing the x script.
When the file Complex.c is compiled, a static class variable is
referenced:
lnnk_ATTLC<complex>::pool
This variable is undefined in the Complex.o file! I think it should
be a symbol with allocated memory in the DATA segment of the object
file.
The symbol is declared in the file List.c:15. This line ends up at
line 1033 in the Complex.ii file.
Am I correct in my understanding that this symbol/variable should
be allocated/created in the Complex.o file? Is there some aspect
of templates that I'm not understanding?
Thanks for any of your help.
######## x.out #########
Reading specs from
/opt/TWWfsw/gcc29/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/specs
gcc version 2.95.2 19991024 (release)
/opt/TWWfsw/gcc29/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/cpp -lang-c++ -v
-I. -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -Dhppa -D
hp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -D__hppa__ -D__hp900
0s800__ -D__hp9000s800 -D__hp9k8__ -D__PWB__ -D__hpux__ -D__unix__ -D__hpp
a -D__hp9000s800 -D__hp9k8 -D__PWB -D__hpux -D__unix -Asystem(unix) -Asyst
em(hpux) -Acpu(hppa) -Amachine(hppa) -D__EXCEPTIONS -g -Wno-non-template-f
riend -D__hp9000s700 -D_PA_RISC1_1 -D_HPUX_SOURCE -D_HIUX_SOURCE -D__STDC_
EXT__ -DINCLUDE_TEMPLATE_DEFINITIONS Complex.c Complex.ii
GNU CPP version 2.95.2 19991024 (release) (hppa)
#include "..." search starts here:
#include <...> search starts here:
.
/opt/TWWfsw/gcc29/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/../../../../incl
ude/g++-3
/opt/TWWfsw/gcc29/include
/opt/TWWfsw/gcc29/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/../../../../hppa
1.1-hp-hpux10.20/include
/opt/TWWfsw/gcc29/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/include
/usr/include
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
/opt/TWWfsw/gcc29/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/cc1plus
Complex.ii -quiet -dumpbase
Complex.cc -mpa-risc-1-1 -g -Wno-non-template-friend -version -fno-for-sco
pe -o Complex.s
GNU C++ version 2.95.2 19991024 (release) (hppa1.1-hp-hpux10.20) compiled
by GNU C version 2.95.2 19991024 (release).
/opt/TWWfsw/gcc29/hppa1.1-hp-hpux10.20/bin/as -o Complex.o Complex.s
/usr/ccs/bin/ld: Unsatisfied symbols:
lnnk_ATTLC<complex>::pool (data) <<<#### undefined variable!!!!!
collect2: ld returned 1 exit status
_____________________________________________________________________
Tracy Vandeventer e-mail: tracy_vandeventer@agilent.com
Agilent Technologies USmail: 1900 Garden of the Gods Road
Colorado Springs Division PO Box 2197
Phone: (719) 590-2640 Colorado Springs, CO 80901-2197
_____________________________________________________________________
x.tar.gz