Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!munnari!otc!metro!basser!usage!elecvax!spinifex!malcolmp From: malcolmp@spinifex.eecs.unsw.oz (Malcolm Purvis) Newsgroups: comp.lang.c++ Subject: Re: Multiple inclusion of virtual tables... Message-ID: <340@spinifex.eecs.unsw.oz> Date: 23 Mar 89 01:08:12 GMT References: Organization: Kenso Kindi (UNSW) Lines: 33 From article , by grunwald@flute.cs.uiuc.edu: > >I'd thought about +e -- the problem being that > (a) this requires changing the entire makefile > (b) requires a very strict naming convention for files. > >E.g., If I have class ``SimulationMultiplexor'' (I do), >then I need to have a file with the same name. That's not so bad, >except on SysV (which, thank god, I'm not using). > >Using #pragma means you need to change one line in the Makefile >(the one defining C++FLAGS) and lets you use whatever file >naming convention you want. [My apologies if this topic has discussed in depth before.] Couldn't you change the compiler to do the equivalent of +e automatically so you wouldn't have these problems? You could put in rules that say if when compiling a file it finds a constructor/destructor for a class, then the vtbl for that class is defined in this file, otherwise it is declared external. This results in the vtbl being declared in one place just as with +e, but you could then name your files however you like, and also you wouldn't have to change the Makefile. Of course the contructor/destructor rule is probably insufficient by itself, especially if the class has all inline member functions (inline virtual functions? How strange), but you should get the idea. Malcolm Purvis (malcolmp@{spectrum,spinifex}.eecs.unsw.oz) University of NSW, Sydney, Australia. Honours: The students treat you like geniuses, the staff like postgrads, and the administration like children........