This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
-frepo and missing symbols on FreeBSD
- To: egcs-bugs at cygnus dot com
- Subject: -frepo and missing symbols on FreeBSD
- From: bryan at yahoo-inc dot com (bryan d. o'connor)
- Date: Wed, 14 Jan 1998 18:10:27 -0800 (PST)
i'm having problems with template instantiation when i am compiling
a rather large multi-file program that uses STL. to get around the
multiple definitions of free_list, etc.. i started using the template
repository (-frepo). it fixed the problem with multiple defs but now
i'm getting undefined symbols for some things.
i narrowed it down to a small test case:
FreeBSD 2.1.7.1
gcc version egcs-2.90.23 980102 (egcs-1.0.1 release)
sample program:
#include <map>
#ifndef REPO
template less<int>;
template map<int, int, less<int> >;
#endif
main() {
map<int, int, less<int> > foo;
}
> egcs++ -c foo.cc # explicitly instantiating..
> egcs++ -o foo foo.o
works. (and actually, in this case, not explicitly instantiating
does work also -- but it breaks for the multi-file case.)
> egcs++ -frepo -DREPO -c foo.cc # using the repository..
> egcs++ -frepo -o foo foo.o
foo.o: Undefined symbol `rb_tree<int, pair<int const, int>, select1st<pair<int const, int> >, less<int>, __default_alloc_template<false, 0> >::__erase(__rb_tree_node<pair<int const, int> > *)' referenced from text segment
collect2: ld returned 1 exit status
looking at foo.rpo, i do see an entry for this symbol:
O __erase__t7rb_tree5ZiZt4pair2ZCiZiZt9select1st1Zt4pair2ZCiZiZt4less1ZiZt24__default_alloc_template2b0i0Pt14__rb_tree_node1Zt4pair2ZCiZi
any suggestions? thanks!
...bryan