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]

Templates and Linking


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


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