Subject: Re: g++ problem "-fno-implicit-templates"
From: [email-masked] (John F. Kolen)

14 Nov 1997 12:16:15 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
To: [email-masked], Russ Vreeland <[email-masked]>

My experiences with g++ under gnuwin have been similar.  After beating on
the template problem for a while, I finaly came up with the following solution:
use -frepo.  Here's what I have to do

1. Compile all the modules with the -frepo flag.
2. Attempt to link the modules normally and save the linker error messages.
3. Explicitly declare the missing template expansions in one of the modules
   (I normally put these in the module with main()).
4. Repeat steps 1, 2 and 3 until no more linker errors.

For instance, the last time I compile something with g++ I had to add
the following lines to one of the modules:

template class __default_alloc_template<false, 0>;
template class __malloc_alloc_template<0>;
template void list<IOPair , __default_alloc_template<false, 0> >::clear(void);
template void list<Encoding *, __default_alloc_template<false, 0>
>::clear(void);

Note that I was using STL's list template ( list<IOPair> and list<Encoding*> )
and needed the later two template instantiations.  Hopefully this problem with
-frepo will be cleaned up in later versions of g++.

Also, I found "Mumit's STL Newbie guide" to be very helpfull in finding this
solution.

John

-- 
John F. Kolen				voice: (850)474-3075 
Assistant Professor			fax:   (850)474-3023
Dept. of Computer Science
University of West Florida
Pensacola, FL 32514
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".