This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: C++ automatic template instantiation?



  On Wednesday, 19 April 2000, Mike Stump wrote:
> It won't be without bug reports.  With bug reports it stands a chance
> at bug fixes.  Generally speaking, if you want to know if it works in
> a particular instance, you're going to have to try it.

Here is one.  Please notice that subsequent invocations of "c++ t.o"
generate different error messages.

Tudor

RedHat Linux 6.2,
Reading specs from /home/tudor/opt/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)

stack.cc:

#include <stack>
int main() { stack<int> x; }

[tudor@data]:~ $ c++ -frepo -c t.cc
[tudor@data]:~ $ c++ t.o

collect: recompiling t.cc
collect: relinking
t.o: In function `deque<int, allocator<int>, 0>::~deque(void)':
t.o(.text+0x51): undefined reference to `_Deque_base<int, allocator<int>, 0>::~_Deque_base(void)'
t.o: In function `_Deque_base<int, allocator<int>, 0>::_Deque_base(allocator<int> const &, unsigned int)':
t.o(.text+0xa7): undefined reference to `_Deque_base<int, allocator<int>, 0>::_M_initialize_map(unsigned int)'
t.o: In function `deque<int, allocator<int>, 0>::deque(allocator<int> const &)':
t.o(.text+0xf7): undefined reference to `_Deque_base<int, allocator<int>, 0>::~_Deque_base(void)'
collect2: ld returned 1 exit status

[tudor@data]:~ $ c++ t.o

collect: recompiling t.cc
collect: relinking
t.o: In function `_Deque_base<int, allocator<int>, 0>::~_Deque_base(void)':
t.o(.text+0x83): undefined reference to `_Deque_base<int, allocator<int>, 0>::_M_destroy_nodes(int **, int **)'
t.o: In function `_Deque_base<int, allocator<int>, 0>::_M_initialize_map(unsigned int)':
t.o(.text+0x169): undefined reference to `_Deque_base<int, allocator<int>, 0>::_M_create_nodes(int **, int **)'
collect2: ld returned 1 exit status

[tudor@data]:~ $ c++ t.o

collect: recompiling t.cc
collect: relinking
t.o: In function `deque<int, allocator<int>, 0>::~deque(void)':
t.o(.gnu.linkonce.t._._t5deque3ZiZt9allocator1ZiUi0+0x51): undefined reference to `_Deque_base<int, allocator<int>, 0>::~_Deque_base(void)'
t.o: In function `deque<int, allocator<int>, 0>::deque(allocator<int> const &)':
t.o(.deque<int, allocator<int>, 0>::gnu.linkonce.t.(allocator<int> const &)+0x37): undefined reference to `_Deque_base<int, allocator<int>, 0>::~_Deque_base(void)'
t.o: In function `_Deque_base<int, allocator<int>, 0>::_Deque_base(allocator<int> const &, unsigned int)':
t.o(._Deque_base<int, allocator<int>, 0>::gnu.linkonce.t.(allocator<int> const &, unsigned int)+0x43): undefined reference to `_Deque_base<int, allocator<int>, 0>::_M_initialize_map(unsigned int)'
collect2: ld returned 1 exit status

[tudor@data]:~ $ c++ t.o

collect: recompiling t.cc
collect: relinking
t.o: In function `_Deque_base<int, allocator<int>, 0>::~_Deque_base(void)':
t.o(.text+0x19b): undefined reference to `_Deque_base<int, allocator<int>, 0>::_M_destroy_nodes(int **, int **)'
t.o: In function `_Deque_base<int, allocator<int>, 0>::_M_initialize_map(unsigned int)':
t.o(.text+0x285): undefined reference to `_Deque_base<int, allocator<int>, 0>::_M_create_nodes(int **, int **)'
collect2: ld returned 1 exit status

[tudor@data]:~ $


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]