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: [egon.schaal@cad-consulting.wn.eunet.de: gnuwin32, ld]


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".


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