delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/22/14:04:26

Message-Id: <m0xD7BR-000S1mC@inti.edu.ar>
Comments: Authenticated sender is <salvador AT natacha DOT inti DOT edu DOT ar>
From: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT edu DOT ar>
Organization: INTI
To: Jean-Michel Brissiaud <brissiau AT miage DOT isi DOT u-psud DOT fr>, djgpp AT delorie DOT com
Date: Mon, 22 Sep 1997 15:27:17 +0000
MIME-Version: 1.0
Subject: Re: template problems

Jean-Michel Brissiaud <brissiau AT miage DOT isi DOT u-psud DOT fr> wrote:
> Gordon German wrote:
> > PS. I have since tried a small test program which calls the
> > implimentation file:
> > 
> >     #include "matrix.cc"
> > 
> > and matrix.cc includes matrix.h. This actually works, no errors. This
> > trick doesn't seem to work for multi-file projects, however. You either
> > get a "multiple define" error (if you include matrix.cc with each file 
> 
> If your matric.cc file constains function's body, when you use it in
> multi-file projects, their body is defined each time.
> To solve your problem create an object matrix.o in compiling matrix.cc
> and include only matrix.h in your other .cc files.

Even when it could work I'll suggest to read the gcc.info file. There are 3 
methodes  explained on how to workaround the fact that GCC DOESN'T support 
templates in a automatic way like Borland and other compilers does.

SET
------------------------------------ 0 --------------------------------
Visit my home page: http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-sot AT usa DOT net - ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019