Subject: Re: [[email-masked]: gnuwin32, ld]
From: [email-masked] (Mumit Khan)

20 Jul 1997 16:01:55 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: Ian Lance Taylor <[email-masked]>, [email-masked]
In-Reply-To: Your message of "Sun, 20 Jul 1997 10:37:21 PDT."
             <[email-masked]> 
Original-Sender: [email-masked]

Ian Lance Taylor <[email-masked]> 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
"[email-masked]" with one line of text: "help".