delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/11/14/12:16:15

From: jkolen AT typhoon DOT coginst DOT uwf DOT edu (John F. Kolen)
Subject: Re: g++ problem "-fno-implicit-templates"
14 Nov 1997 12:16:15 -0800 :
Message-ID: <9711140940.ZM12639.cygnus.gnu-win32@typhoon.coginst.uwf.edu>
References: <russv AT ikos DOT com>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com, Russ Vreeland <russv AT ikos DOT com>

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 AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019