From: etlmllg AT etlxdmx DOT ericsson DOT se (Mike Legg) Subject: Templates and Linking 31 Aug 1997 13:10:14 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <3406AD50.BA7598A4.cygnus.gnu-win32@etlxdmx.ericsson.se> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------6B9F3BE270939F019BAD2095" X-Mailer: Mozilla 4.0 [en] (Win95; I) Original-To: gnu-win32 AT cygnus DOT com X-Priority: 3 (Normal) Original-Sender: owner-gnu-win32 AT cygnus DOT com This is a multi-part message in MIME format. --------------6B9F3BE270939F019BAD2095 Content-Type: text/plain; charset=us-ascii Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit 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::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. --------------6B9F3BE270939F019BAD2095 Content-Type: application/x-unknown-content-type-PFE32; name="Table.h" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="Table.h" I2lmbmRlZiBUQUJMRV9IDQojZGVmaW5lIFRBQkxFX0gNCg0KI2luY2x1ZGUgPGxpc3Q+DQoj aW5jbHVkZSA8c3RyaW5nPg0KI2luY2x1ZGUgPGlvc3RyZWFtLmg+DQoNCmNsYXNzIFRhYmxl IA0KewkNCgkJdHlwZWRlZiBsaXN0PHN0cmluZz4gVGFibGVUeXBlOw0KCQlUYWJsZVR5cGUg dGFibGU7DQoJCXN0cmluZyB0aXRsZTsNCglwdWJsaWM6CQkNCgkJVGFibGUoY29uc3Qgc3Ry aW5nJiB0KTsNCgkJdm9pZCBhZGQoY29uc3Qgc3RyaW5nJiBlbGVtKTsNCgkJdm9pZCBvdXRw dXQoKTsNCn07DQoNCiNlbmRpZiBUQUJMRV9IDQoNCgkNCg0K --------------6B9F3BE270939F019BAD2095 Content-Type: application/x-unknown-content-type-PFE32; name="Table.cc" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="Table.cc" I2luY2x1ZGUgPGxpc3Q+DQojaW5jbHVkZSA8c3RyaW5nPg0KI2luY2x1ZGUgPGlvc3RyZWFt Lmg+DQojaW5jbHVkZSAiVGFibGUuaCINCg0KVGFibGU6OlRhYmxlKGNvbnN0IHN0cmluZyYg dCk6IHRpdGxlKHQpIHt9DQoNCnZvaWQgDQpUYWJsZTo6YWRkKGNvbnN0IHN0cmluZyYgZWxl bSkgDQp7DQoJdGFibGUucHVzaF9iYWNrKGVsZW0pOw0KfQ0KDQp2b2lkIA0KVGFibGU6Om91 dHB1dCgpDQp7DQoJY291dCA8PCAiVGFibGU6ICIgPDwgdGl0bGUgPDwgZW5kbDsNCglmb3Ig KFRhYmxlVHlwZTo6aXRlcmF0b3IgaSA9IHRhYmxlLmJlZ2luKCk7IGkgIT0gdGFibGUuZW5k KCk7IGkrKykgDQoJCWNvdXQgPDwgKCppKSA8PCBlbmRsOw0KfQ0KDQo= --------------6B9F3BE270939F019BAD2095 Content-Type: text/plain; charset=us-ascii; name="Makefile" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Makefile" 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 --------------6B9F3BE270939F019BAD2095 Content-Type: application/x-unknown-content-type-PFE32; name="Main.cc" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="Main.cc" I2luY2x1ZGUgPHN0cmluZz4NCiNpbmNsdWRlICJUYWJsZS5oIg0KDQppbnQNCm1haW4oaW50 IGFyZ2MsIGNoYXIqKiBhcmd2KQ0Kew0KCVRhYmxlIHRhYmxlKCJDb21tYW5kIExpbmUgQXJn dW1lbnRzIik7DQoJZm9yIChpbnQgaT0wOyBpPGFyZ2M7IHRhYmxlLmFkZChhcmd2W2krK10p KTsNCgl0YWJsZS5vdXRwdXQoKTsNCn0NCg== --------------6B9F3BE270939F019BAD2095-- - 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".