This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Template Class Problem
- To: egcs-bugs at egcs dot cygnus dot com
- Subject: Template Class Problem
- From: Gerald Gutierrez <gutier at intergate dot bc dot ca>
- Date: Tue, 27 Apr 1999 00:33:50 -0700
- Organization: Home
- Reply-To: gutier at intergate dot bc dot ca
EGCS-1.1.2
Redhat 5.2 Intel
Below is what I believe to be another problem with templates. I've got a
parameterized class called Alpha within the files Alpha.cc and Alpha.h.
They compile fine but after the compile Alpha.o doesn't contain any
symbols relating to the Alpha class! Naturally, links against this file
fail.
If this is somehow my fault or it is a bug and there is a workaround,
please let me know. This particular problem is seriously hosing me ...
[ template_bug]$ ls -l
total 2
-rw-rw-r-- 1 gerald gerald 114 Apr 27 00:33 Alpha.cc
-rw-rw-r-- 1 gerald gerald 82 Apr 27 00:32 Alpha.h
[ template_bug]$ cat Alpha.h
template<class T>
class Alpha
public:
Alpha (void);
~Alpha (void);
};
[ template_bug]$ cat Alpha.cc
#include "Alpha.h"
template<class T>
Alpha<T>::Alpha (void) { }
template<class T>
Alpha<T>::~Alpha (void) { }
[ template_bug]$ g++ -c Alpha.cc
[ template_bug]$ ls -l
total 3
-rw-rw-r-- 1 gerald gerald 114 Apr 27 00:33 Alpha.cc
-rw-rw-r-- 1 gerald gerald 82 Apr 27 00:32 Alpha.h
-rw-rw-r-- 1 gerald gerald 817 Apr 27 00:38 Alpha.o
[ template_bug]$ nm --demangle Alpha.o
00000000 ? __FRAME_BEGIN__
00000000 t gcc2_compiled.
[ template_bug]$