From: khan@xraylith.wisc.edu (Mumit Khan)
Subject: Re: [egon.schaal@cad-consulting.wn.eunet.de: gnuwin32, ld]
20 Jul 1997 16:01:55 -0700
Approved: cygnus.gnu-win32@cygnus.com
Distribution: cygnus
Message-ID: <9707202134.AA07052.cygnus.gnu-win32@modi.xraylith.wisc.edu>
Original-To: Ian Lance Taylor <ian@cygnus.com>, gnu-win32@cygnus.com
In-Reply-To: Your message of "Sun, 20 Jul 1997 10:37:21 PDT."
             <199707201737.KAA03678@rtl.cygnus.com> 
Original-Sender: owner-gnu-win32@cygnus.com

Ian Lance Taylor <ian@cygnus.com> writes:
> What's the magic option or code to use to avoid this problem?
> 
> Ian

[ multiple defs of STL allocator fns problem with gnu-win32 gcc ]

This problem arises when you let gcc instantiate everything statically
in your program units (ie., -fimplicit-templates). This is usually a
bad thing anyway for anything other than tiny toy programs, since the
code bloat is unacceptable in any real software.

Two ways to avoid it:

    1. Use -fno-implict-templates (explicit instantiation). Currently 
       with gcc (IMO) this is the only viable and portable option.
    
    2. Use -frepo. For some reason, gcc on '95 doesn't do this correctly
       (collect2/ld doesn't invoke recompilations based on the *.rpo
       files). I use linux to build win32 apps, and it works find with
       my x-build environment.

Both are documentated (along with the gotchas) in my STL newbie guide
(URL after sig).  It's quite dated, but gcc related info is quite
relevant.

Mumit
http://www.xraylith.wisc.edu/~khan/
http://www.xraylith.wisc.edu/~khan/software/stl/STL.newbie.html

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
