Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!nrl-cmf!ames!amdcad!sun!pitstop!sundc!seismo!uunet!munnari!uqcspe!banana!tony From: tony@banana.cs.uq.oz (Tony O'Hagan) Newsgroups: comp.lang.c++ Subject: Re: Zortech bugs Message-ID: <2285@uqcspe.cs.uq.oz> Date: 8 Feb 89 12:39:24 GMT References: <2118@windy.dsir.govt.nz> <4800049@m.cs.uiuc.edu> Sender: news@uqcspe.cs.uq.oz Reply-To: tonyo@qitfit.qitcs.oz (Tony O'Hagan) Organization: Computer Science, Queensland Uni, Australia Lines: 28 In article <4800049@m.cs.uiuc.edu> rchen@m.cs.uiuc.edu writes: > >Zortech C++ didn't handle duplicate const declarations as well, so I >cann't put "const int a = 1;" in the header file. Otherwise, Zortech >C++ is fine with me so far. > >-Ron Chen I have a similar problem ... Zortech won't link multiple object files created from a header containing a class with static variables. My guess is that each time you #include the class declaration it's static variables are defined as local to the object file. When they get linked every object file which uses the class thinks it has the original static variables rather than an extern reference. Deciding which object file should contain the real variables sounds like a juicy problem (or a new version of the linker). Not being able to have such a class in a header file rather defeats the purpose of having the class declaration. Any suggestions or hopes Walter Bright ? How do Unix implementation get around this ? Tony O'Hagan P.S. I'm using ZTC Version 1.04