From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII X-Google-Thread: fa528,928f8bee559cdab2,start X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2001-11-01 03:24:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!newsfeed.wirehub.nl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dns.phoenix-ag.de!news.uni-stuttgart.de!not-for-mail From: tobi@bland.fido.de (Tobias Ernst) Newsgroups: comp.unix.tru64 Subject: CXX compiler problem Date: Thu, 01 Nov 2001 11:20:38 MEZ Organization: Fido.De Host Baden-Wuerttemberg Message-ID: <1004614139@f1.n7600.z242.fido.de> NNTP-Posting-Host: holmes.physcip.uni-stuttgart.de Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Comment-To: All X-MailConverter: SoupGate-Unix v1.42 Xref: archiver1.google.com comp.unix.tru64:5613 Hallo All! I have a problem with the template instantiation code in CXX on this platform: tobi@caracal(524):~/appt/pore> uname -a; cxx -V; cc -V OSF1 caracal.ica1.uni-stuttgart.de V5.0 910 alpha Compaq C++ V6.3-014 for Digital UNIX V5.0 (Rev. 910) Compiler Driver V6.3-014 (cxx) cxx Driver Compaq C V6.4-214 (dtk) on Digital UNIX V5.0 (Rev. 910) Compiler Driver V6.4-014 (dtk) cc Driver The error I get when linking my application is this: Unresolved: GrayHist, 3>::porosity(void) GrayHist, 3>::alt_specsurf(void) Now the problem is that the class PTC_ParaIArray is defined as template class PTC_ParaIArray:public PTC_ParaIArray_Base {...}; So you see that the type parameter T must be first and the integer parameter NDIM must be last. The file that provides alt_specsurf and porosity contains the correct symbols (verified with nm): GrayHist, 3>::alt_specsurf(void) GrayHist, 3>::porosity(void) However, for some mysterious reason, the object file where I call these functions mysteriously contains requests for GrayHist, 3>::alt_specsurf(void) GrayHist, 3>::porosity(void) i.E. the integer parameter 3 before the type parameter signed char. The cxx files that produce those two object files include the SAME .h file with the definitions of PTC_ParaIArray. So why on earth does cxx resort the template parameters in the one object file, but not in the other !? The code compiles flawlessly with gcc 2.95.2 and with KAI KCC. The code does not work with Compaq CXX 6.3-014 and CXX 6.3-012. If anybody is interested, I can compile a more formal testcase. Viele Gr��e, Tobias