This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Templates and Linking
- To: gnu-win32 at cygnus dot com
- Subject: Templates and Linking
- From: Mike Legg <etlmllg at etlxdmx dot ericsson dot se>
- Date: Fri, 29 Aug 1997 12:07:03 +0100
Hi,
Does anyone know how to get around this error which is reported during
linking when using the STL:
Table.o(.data+0xc):Table.cc: multiple definition of
`__default_alloc_template<false, 0>::free_list'
Main.o(.data+0x0):Main.cc: first defined here
The exact same code compiles fine on gcc2.7.2 with djgpp. Is there any
reason why template intansiation is different?
Attached is a trivial example.
regards,
Mike.
Table.h
Table.cc
compile = g++ -c
link = g++
objects = Main.o Table.o
test.exe: $(objects)
$(link) -o test.exe $(objects)
Main.o: Main.cc
$(compile) Main.cc
Table.o: Table.h Table.cc
$(compile) Table.cc
Main.cc