Mail Archives: cygwin/1997/07/20/16:01:55
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 -