delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/07/20/16:01:55

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

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

- Raw text -


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