Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by w2martin
Thu, 06 Aug 1992 19:50
Forward declaration of templates fail
Author: w2martin
Date: Thu, 06 Aug 1992 19:50
Date: Thu, 06 Aug 1992 19:50
45 lines
1644 bytes
1644 bytes
Hi!
I am using the following:
IBM RS 6000 running AIX 3.2
g++ I believe version gcc-2.2.2 (it knows about templates)
----------------------------------------------------------------------------
The following program runs without any problems:
//template<class T> int myfunc(T x);
template<class T> int myfunc(T x) {
return 2;
}
int myfunc2(int x);
int myfunc2(int x) {
return 2;
}
main() {
myfunc(3);
myfunc2(0);
}
----------------------------------------------------------------------------
Now uncomment the first line to create a forward declaration, I get the
following problem:
bart /u/w2martin/c : g++ g++test.C
0706-317 ERROR: Unresolved or undefined symbols detected:
Symbols in error (followed by references) are
dumped to the load map.
.myfunc__Fi
collect: /bin/ld returned 8 exit status
----------------------------------------------------------------------------
What is wrong? The IBM xlC C++ compiler accepts the same code, but I want
to use g++ since we have it at MIT.
If you could help me, write to w2martin@watson.ibm.com OR to
martins@athena.mit.edu
Thanks,
Martin Szummer
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads