This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


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

Re: g++ problem "-fno-implicit-templates"


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
"gnu-win32-request@cygnus.com" with one line of text: "help".


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